The whole syllabus, in one place. Every topic is explained in simple with a real-life example, followed by practice questions from easy to hard.
Core vocabulary of DSA: data, record, file, primitive/non-primitive, linear/non-linear, static/dynamic and ADT.
The six basic operations on any data structure: traversal, insertion, deletion, searching, sorting and merging.
What an algorithm is, its properties, how to write it, and how to analyse its time and space with step counting and best/average/worst cases.
Big-O, Omega, Theta and little-o: how we describe the growth of running time for large n, with common growth rates and rules.
Using more memory to save time, or less memory at the cost of more time: lookup tables, memoization, compression and recomputation.
An array stores same-type items in consecutive memory, so the address of any item is found by one formula; a record groups different-type fields.
A function that calls itself on a smaller input until a base case stops it; each call waits on the call stack.
Practise finding Big-O of single loops, nested loops, log loops and recursive functions, with real step counts.
A stack is a LIFO list where push and pop happen only at the top.
Stacks convert infix to postfix/prefix, match brackets and power recursion.
Evaluate a postfix expression in one scan: push operands, apply operators on the top two.
A queue is a FIFO list: add at the rear, remove from the front.
A circular queue treats the array as a ring so freed slots are reused.
A priority queue serves the highest priority first; a deque inserts and deletes at both ends.
Build a FIFO queue from two LIFO stacks, and a LIFO stack from queues, by reversing order with a second structure.
A linked list stores items in nodes (data + next link) scattered in memory; HEAD points to the first node and the last node's link is null.
Insert or delete in a singly linked list by changing only a few links: at the beginning, at the end, or after/at a given node.
Stack and queue built on linked lists: no fixed size, no overflow (until memory ends). Stack uses head insertion/removal; queue uses front and rear pointers.
A linked list whose every node stores data plus two links, prev and next, so you can walk both forward and backward.
A linked list whose last node points back to the first, so there is no null and traversal can loop forever.
Three classic linked list problems solved with pointer tricks: reversing links, slow and fast pointers, and Floyd cycle detection.
Store each term (coefficient, exponent) as a node in decreasing exponent order; adding two polynomials is a merge of two sorted lists.
Find a key in an array: linear search checks one by one (O(n)); binary search halves a sorted array each step (O(log n)).
Three simple O(n^2) sorts: selection (pick the minimum), bubble (swap neighbours), insertion (insert into sorted part).
Quick sort picks a pivot, partitions the array around it, then sorts both sides recursively: average O(n log n), in-place, unstable.
Merge sort splits the array in halves, sorts each half recursively and merges them: always O(n log n), stable, needs O(n) extra space.
Heap sort turns the array into a max-heap, then repeatedly moves the biggest element to the end. O(n log n) always, O(1) extra space.
Compare the five sorting methods on time, space, stability and in-place use, and pick the right one for the job.
Hashing maps a key to an array index with a hash function, giving average O(1) insert, search and delete.
A tree is a hierarchical structure of nodes: learn root, leaf, height, depth, and the types of binary trees.
Store a binary tree with arrays or nodes, and visit it in preorder, inorder, postorder or level order.
A threaded binary tree reuses the n+1 null pointers as threads to inorder neighbours, so inorder needs no stack.
A BST keeps smaller keys on the left and larger keys on the right, so search, insert and delete follow one path.
An AVL tree is a self-balancing BST that keeps the height difference of subtrees within 1 using four rotations.
Binary trees power expression evaluation, Huffman compression, heaps, BST search, decision making and file systems.
Multiway balanced search trees built for disks: fat nodes, tiny height, few disk reads. B+ keeps data in linked leaves.
A graph is vertices joined by edges. Learn the vocabulary and store it as an adjacency matrix or adjacency list.
Visit a graph level by level using a queue: all neighbours first, then their neighbours. O(V+E).
Go as deep as possible, then backtrack: recursion or an explicit stack. O(V+E). Compared with BFS, plus cycles and components.