Explore our collection of technical articles, tutorials, and insights from the TryAlgoViz team.
From O(N²) brute force to O(N) hash map — a step-by-step breakdown.
Learn how to check if two strings are anagrams using sorting and hash maps, with clear examples, real-life analogy, and complexity analysis.
Find the first occurrence of a substring in a string. Learn brute-force and pointer-based approaches with dry runs, algorithms, and complexity analysis.
Discover how to split your search space in half with every step. Perfect for searching sorted arrays.
Master recursion and merging techniques. Understand the stable O(N log N) sorting strategy.
Master the mechanics of node pointer updates. Learn to reverse singly linked lists iteratively.
Learn top-down memoization to optimize exponential recursions down to linear efficiency.
Explore recursive tree traversals. Learn how to traverse a BST in sorted ascending order.
Understand the simplest search algorithm. Learn when linear scan beats binary search and how to implement it in every major language.
Master the two-pointer pattern to solve pair-sum, palindrome, and sliding-window problems in linear time.
Dive deep before backtracking. Learn recursive and iterative DFS with applications in cycle detection, topological sort, and more.
Explore graphs level by level using a queue. Learn how BFS finds shortest paths and how to apply it to grids and trees.
Understand nodes, pointers, and dynamic memory. Learn to build, traverse, and modify singly linked lists from scratch.
Learn the LIFO principle with push, pop, and peek operations. See how stacks power undo systems, expression parsing, and DFS.
Master the FIFO principle with enqueue, dequeue, and front operations. See how queues power BFS, task scheduling, and more.
A gentle introduction to programming fundamentals: variables, conditionals, loops, functions, and arrays — with examples in five languages.
Print right triangles, pyramids, diamonds, and butterflies — the visual way to internalise nested loops before tackling 2D arrays.
The simplest sort: walk the array swapping adjacent pairs until everything bubbles into place. Learn the early-exit optimisation that gives O(N) best-case time.
Find the minimum, swap it into place, repeat. Selection sort minimises swap count, making it the right choice when writes are expensive.
The way you sort a hand of playing cards. Fast on nearly-sorted input (O(N) best case) and the foundation of Python's real-world Tim Sort.
How does O(1) lookup actually work? Walk through hash functions, the collision problem, and the two resolution strategies that power every hash map.
The vocabulary (root, leaf, depth, height), how to build a tree in code, and why recursion is the tree's best friend. Prep for DFS and BFS.
Three orderings, one skeleton — pre/in/post-order differ only in WHERE the visit happens. Includes the post-order pattern behind Path Sum and LCA.
Visit nodes level by level using a queue. Includes the level-by-level grouping variant and where BFS shows up in graph problems later.
Understand what data structures are, why they matter, and how to pick the right one — arrays, hash maps, stacks, queues, trees, and graphs explained simply.
A clear introduction to algorithms — what they are, their four key properties, how they differ from programs, and the major algorithm families you will encounter.
Master Big O notation from O(1) to O(n!). Learn why constants are dropped, how to calculate complexity from code, and why it matters at scale.
Learn how to measure memory usage with Big O, understand stack space from recursion, and master the fundamental time vs space trade-off every algorithm makes.
How a binary heap keeps the min (or max) at your fingertips in O(log n), and why it powers priority queues.
How the left-smaller / right-larger rule turns a tree into a searchable, ordered structure — plus validation and kth-smallest.
Adjacency lists vs. matrices, directed vs. undirected, weighted vs. unweighted — the vocabulary behind every graph algorithm.
Greedily expand the closest unsettled vertex to find shortest paths in a graph with non-negative weights.
Relax every edge V−1 times to handle negative weights, and detect negative cycles along the way.
The choose / explore / un-choose template behind N-Queens, Sudoku, and maze solving.
When recursion repeats work, memoization and tabulation turn exponential into polynomial.
The canonical DP table: for each item and capacity, take it or leave it to maximize value.
A bottom-up DP over amounts that also generalizes to counting the number of ways.
When taking the best choice at each step provably gives the best overall answer — activity selection, job sequencing, fractional knapsack.
Repeatedly merge the two least-frequent symbols to build a minimum-cost prefix code.
Near-constant-time union and find with path compression and union by rank — the backbone of connectivity and cycle detection.
Store strings character by character for O(length) insert and search — plus autocomplete and longest-common-prefix.
Slide a window across an array to answer subarray questions in O(n) instead of O(n²).
Treat a 2D grid as an implicit graph: explore neighbors with BFS for shortest paths and DFS for flood fill.