Data Structures & Algorithms
A systematic guide to DSA ā from foundational concepts and linear structures to trees, graphs, and advanced algorithms. Each topic includes complexity analysis, visual diagrams, and multi-language code implementations.
Introduction & Foundation
[PLACEHOLDER ā brief overview of why DSA is important, what the introduction section covers]
Linear Data Structures
[PLACEHOLDER ā description of linear structures: contiguous/sequential memory, pointer-based chains, LIFO/FIFO abstractions]
Array
[PLACEHOLDER ā contiguous memory, O(1) random access, fixed size vs dynamic array, cache locality]
Linked List
[PLACEHOLDER ā node-based pointers, dynamic size, singly/doubly/circular variants, O(1) insert at head]
Stack
[PLACEHOLDER ā LIFO abstraction, call stack, undo operations, expression bracket matching]
Queue
[PLACEHOLDER ā FIFO abstraction, BFS graph traversal, scheduling, deque/circular queue variants]
| Structure | Access | Insert (front) | Insert (back) | Best For |
|---|---|---|---|---|
| Array | O(1) | O(n) | O(1) amort. | [PLACEHOLDER ā random access, cache-friendly iteration] |
| Linked List | O(n) | O(1) | O(1)* | [PLACEHOLDER ā frequent front insertions/deletions] |
| Stack | O(n) | ā | O(1) | [PLACEHOLDER ā LIFO, DFS, undo stack] |
| Queue | O(n) | O(1) | O(1) | [PLACEHOLDER ā FIFO, BFS, job scheduling] |
Hashing
[PLACEHOLDER ā hash functions, collision resolution strategies, O(1) average-case lookup and insertion, key-value storage]
Tree Structures
[PLACEHOLDER ā hierarchical node structures, parent/child relationships, BST ordering property, heap shape property, trie prefix property]
Binary Search Tree
[PLACEHOLDER ā ordered binary tree, left < root < right, O(log n) on balanced tree, in/pre/post-order traversal]
Heap / Priority Queue
[PLACEHOLDER ā complete binary tree stored in array, min-heap/max-heap, heapify O(n), O(log n) insert/extract]
Trie (Prefix Tree)
[PLACEHOLDER ā character-by-character prefix storage, O(L) insert/search where L = word length, autocomplete]
Graph Structures
[PLACEHOLDER ā vertices and edges, directed vs undirected, weighted graphs, BFS/DFS traversal, shortest path and cycle detection]
Core Algorithms
[PLACEHOLDER ā algorithmic paradigms: comparison-based sorting, divide-and-conquer binary search, overlapping-subproblem DP]
Sorting Algorithms
[PLACEHOLDER ā Bubble/Selection/Insertion O(n²), Merge/Quick/Heap O(n log n), Radix O(nk) non-comparison]
Binary Search
[PLACEHOLDER ā divide-and-conquer on sorted input, O(log n), classic 3-template: exact / left bound / right bound]
Dynamic Programming
[PLACEHOLDER ā overlapping subproblems + optimal substructure, top-down memoization vs bottom-up tabulation]