How Can I Learn Algorithms and Data Structures From Scratch
How Can I Learn Algorithms and Data Structures From Scratch
Day −∞−∞ to 0: Stick to a programming language like C or C++. Make sure that you are comfortable with
pointers/objects.
Day 1: Understand the concept of Algorithmic complexity. Skip the theory for now, but for every piece
of code you write, you should be able to derive both time and space complexity.
1. Arrays
2. Linked Lists
3. Strings
4. Stacks
5. Queues
Understand their basic operations (insert, delete, search, traversal) and their complexity - Big-O
Algorithm Complexity Cheat Sheet, and code them all.
1. Sorting - Insertion sort, Merge sort, Quick sort, Heap sort, Bucket sort, Counting sort, Radix
sort, External sorting
Day 26 - 50: Once you are comfortable with everything above, start doing problems from,
4. GeeksforGeeks
5. HackerRank
6. InterviewBit
Stick to chapters of arrays, linked lists, strings, stacks, queues and complexity.
1. Tree
a. Binary Tree, Binary Search Tree - Tree traversals, Lowest common ancestor, Depth,
Height & Diameter, Finding k-th smallest element
b. Heaps
Day 61- 90: Refer to the previous resources and start doing problems from trees, hash tables, heaps and
graphs.
Day 101 - ∞∞: You are now better than most of the CS undergrads. Keep revising the above topics and
start competitive programming! Good luck!