■ Data Structures & Algorithms (DSA) - Quick
Notes
1. Arrays
• Fixed-size data structure.
• Operations: Traversal, Insertion, Deletion, Searching, Sorting.
• Common algorithms: Binary Search, Two-pointer technique, Kadane’s Algorithm.
2. Linked List
• Dynamic size, nodes connected with pointers.
• Types: Singly, Doubly, Circular.
• Operations: Insertion, Deletion, Reversal, Middle element.
3. Stacks
• LIFO (Last In First Out).
• Applications: Expression evaluation, Backtracking, Function calls.
4. Queues
• FIFO (First In First Out).
• Types: Simple, Circular, Priority Queue, Deque.
• Applications: Scheduling, Buffer management.
5. Trees
• Hierarchical structure with root, children.
• Binary Tree, BST, AVL, Heap, Trie.
• Traversals: Inorder, Preorder, Postorder, Level order.
6. Graphs
• Set of nodes (vertices) and edges.
• Representations: Adjacency Matrix, Adjacency List.
• Algorithms: BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, Kruskal, Prim.
7. Sorting Algorithms
• Bubble, Selection, Insertion → O(n²).
• Merge Sort, Quick Sort → O(n log n).
• Counting, Radix, Bucket → Non-comparison sorts.
8. Dynamic Programming
• Break problems into subproblems, store results.
• Examples: Fibonacci, Knapsack, LCS, Matrix Chain Multiplication.
9. Complexity Analysis
• Time Complexity: O(1), O(log n), O(n), O(n log n), O(n²).
• Space Complexity: Memory usage of algorithm.
• Best, Worst, Average cases.