Spize Tech

The blog help to build your skill.

Data Structure and algorithm

Questions and Answers

More

How do I learn data structures and algorithms?

I was in the same situation 1 and a half year ago. I will explain how I learnt data structure and algorithms. 

In the following text Algorithms and Data structure which are marked in bold are very important. Learn every algorithm/data structure with it’s time & space complexity, stable, in place, and where it is useful.
 
What to study?
Step 0 :
  • Understand about pointers in C++, structures or classes
  • Learn how to calculate worst case, best case , average case time complexities
    Step 1 :
    Learn few basic sorting algorithms along with their use case and time complexity.
    • Bubble sort
    • Insertion sort
    • Selection sort
    Learn searching algorithms along with time complexity.
    • Linear Search
    • Binary Search
    Step 2 :
    • Stack
    • Queue
    • Single Linked List (Insert at front,back,middle; Delete at front back middle)
    • Double Linked List
    • Circular Linked List
    Step 3 :
    • Learn the following approaches in algorithms
      • Divide and Conquer (Merger Sort, Quick Sort, Binary Search are some examples)
      • Greedy method (Knapsack, Prim’s algorithm, Kruskal’s algorithm, Dijkstra, Bellmanford)
      • Dynamic programming (0/1 Knapsack, Travelling Salesman Problem, Coin change)
    • Backtracking (N Queens problem)

    No comments:

    Post a Comment