Roadmap to master DS and Algorithms
2 min readDec 2, 2020
- Decide first which language you are comfortable enough to implement your Data Structures and Algorithms in. If you choose Java then start with collections framework well.
- Secondly, you need to understand why do we need to study this DSA subject. How does it help a coder. GeeksForGeeks is a good platform for starting off but the first thing you need to learn before jumping on to DS and Algorithm is how to find out the time and space complexity
of an algorithm and what are asymptotic notations. This help you differentiate between different algorithms on the basis of how efficient it is wrt time how fast it runs on any machine and also the space it occupies or which Data Structure lets data to be fetched faster or store data faster or traverse.
Then start off with learning Data Structures first. Start off from Arrays. Then move on to other Data Structures like Linked Lists, Stacks, Queues, Hash Tables (Very useful while solving algorithmic questions), Trees, Graphs, Heaps, Etc. It is highly recommended to you to implement these in your preferred language. Although, you won't be asked to implement them in the interviews since there are built in classes in case you are using Java's Collection Framework. But it will help you understand how we can store data in the Data Structure, fetch it, update it, delete, etc. - Make sure to learn the time complexities and space complexities of each Data Structures thoroughly. Learn implementing basic algorithms related to those Data Structures as well. You will also find related problems in GeeksForGeeks.
- Then move onto algorithms. Learning the basic algorithms on arrays like, in sorting bubble sort, selection sort, merge sort, quick sort, insertion sort and also understand their time complexities - worst and average cases. In searching, make sure you know binary search, it's implementation and its time complexity.
Learn recursion and start off with trying to implement algorithms like binary search using recursion. In fact, Merge sort and quick sort use recursion. Even Tree and Graphs use recursion mostly to do traversals, insertions and deletions. - First, be thorough with the basic data structures like linkedList, stack, queue, binary search tree in this order and searching and sorting algorithms.
- Start solving problems. Initially, go ahead and try with your approach and atleast get the correct output. Then think for optimized solution. If nothing works, go ahead, look at the solution, understand it and implement it without looking at it.
‘This is a not a sprint, but a marathon’: Juan Mata believes Man United still in title race , November 2017 Premier League ,so is DS Algorithm .It would get better every passing day. Make it a habit