Skip to content
Codeloom

← Back to DSA overview

DSA tutorials

277 articles · page 6 of 14

Hand-written tutorials, ordered as a recommended learning path.

  1. 101 Recent Calls Counter Solve Number of Recent Calls using a queue as a 3000ms sliding window counter. Python solution with deque, step-by-step trace, and amortized analysis.
  2. 102 Snakes and Ladders Solve Snakes and Ladders with BFS to find minimum dice rolls. Python solution with 1D-2D conversion, boustrophedon layout, and step-by-step trace.
  3. 103 132 Pattern Solve the 132 Pattern problem using a monotonic stack scanning right to left. Python solution tracking s3 candidates and s2 maximum, with detailed trace.
  4. 104 Sum Subarray Minimums Solve Sum of Subarray Minimums using the contribution technique with monotonic stacks. Python solution with modular arithmetic, traces, and O(n) analysis.
  5. 105 Zigzag Level Order Zigzag level order traversal of a binary tree using BFS and deque. Step-by-step Python solution with visual trace, complexity analysis, and interview tips.
  6. 106 Open the Lock Open the Lock problem solved with BFS on 4-digit state space. Python solution with deadend handling, bidirectional BFS optimization, and complexity analysis.
  7. 107 Word Ladder BFS Word Ladder solved with BFS and pattern matching optimization. Step-by-step Python solution for LeetCode 127 with complexity analysis and interview tips.
  8. 108 Max Frequency Stack Maximum Frequency Stack solved with HashMap and stack groups by frequency. Python implementation with step-by-step trace, complexity analysis, and design insights.
  9. 109 Tag Validator Tag Validator solved with stack-based HTML/XML tag matching and CDATA parsing. Python solution with edge cases, step-by-step trace, and complexity analysis.
  10. 110 Front Middle Back Queue Design Front Middle Back Queue using two balanced deques. Python solution with O(1) operations, step-by-step trace, and complexity analysis for LeetCode 1670.
  11. 111 Interview Patterns Comprehensive catalog of 15+ stack and queue interview patterns with when-to-use guide, Python templates, complexity analysis, and problem mapping for coding interviews.
  12. 112 Validate Stack Sequences Validate Stack Sequences solved by simulating push and pop operations. Python solution with step-by-step trace, edge cases, and complexity analysis for LeetCode 946.
  13. 113 Shortest Subarray Sum K Shortest Subarray with Sum at Least K solved with monotonic deque and prefix sums. Python solution with detailed trace, complexity analysis, and edge cases.
  14. 114 Real-World Applications Real-world applications of stacks and queues: undo/redo systems, browser history, call stacks, task scheduling, message queues, and BFS web crawlers with Python examples.
  15. 115 Next Greater Circular Next Greater Element II solved with monotonic stack and circular array double-length trick. Python solution with step-by-step trace, complexity analysis, and patterns.
  16. 116 BST Operations Master Binary Search Tree operations — insert, search, and all three delete cases with in-order successor. Full Python implementation with time complexity analysis.
  17. 117 AVL Tree Rotations Understand AVL trees — balance factors, all four rotation types (LL, RR, LR, RL), insertion with rebalancing, and complete Python implementation with height tracking.
  18. 118 Red-Black Trees Understand Red-Black trees — the 5 rules, insertion cases, color flips, rotations, comparison with AVL, and why Java TreeMap and Linux use them.
  19. 119 Lowest Common Ancestor Master LCA problems — recursive DFS for binary trees, BST property shortcut, parent pointers, and binary lifting for O(log n) queries. Full Python code.
  20. 120 Tree Diameter & Paths Find the diameter of a binary tree using DFS, solve maximum path sum, and understand the two-BFS approach for general trees. Full Python implementations.