VISUALGO//LEARN
articles and guides to help you understand algorithms and data structures

A* Search Algorithm

intermediate

Learn how A* combines actual cost with a heuristic estimate to find the cheapest path while exploring fewer nodes than Dijkstra.

pathfinding

Backtracking

intermediate

Learn the backtracking algorithm technique for solving constraint satisfaction problems like N-Queens, permutations, and sudoku.

algorithms

Breadth-First Search (BFS)

beginner

Learn how BFS explores graphs level by level using a queue, guaranteeing the shortest path on unweighted graphs.

pathfinding

BFS vs DFS: When to Use Each

beginner

Compare breadth-first and depth-first search to understand when each graph traversal strategy is the right choice.

general

Big-O Basics

beginner

Understand time complexity notation and learn to identify common patterns in your code.

general

Binary Search

beginner

Learn how binary search efficiently finds elements in sorted arrays using divide-and-conquer.

O(log n)searching

Binary Search Tree

intermediate

Learn how binary search trees organize data for efficient searching, insertion, and deletion with O(log n) average performance.

data-structures

Bubble Sort

beginner

Understand the simplest comparison sort: how adjacent swaps bubble elements into place, and why it's O(n^2).

sorting

Depth-First Search (DFS)

beginner

Learn how DFS explores graphs by diving deep into branches before backtracking, using a stack for traversal.

pathfinding

Dijkstra's Algorithm

intermediate

Learn how Dijkstra finds the cheapest path on weighted graphs by expanding nodes in order of total cost.

pathfinding

Dijkstra and A* Search

intermediate

Understand weighted shortest-path algorithms: how Dijkstra explores uniformly by cost, and how A* uses heuristics to search smarter.

general

Dynamic Programming

intermediate

Learn dynamic programming — solving problems by breaking them into overlapping subproblems and reusing results, illustrated with the Fibonacci sequence.

algorithms

Fast and Slow Pointers

intermediate

Learn the two-pointer technique where pointers move at different speeds to solve problems like finding midpoints and detecting cycles.

two-pointers

Graphs and Weighted Graphs

beginner

Understand graph data structures: adjacency lists, edge weights, directed vs undirected, and how pathfinding algorithms operate on them.

general

Hash Maps

beginner

Learn how hash maps provide O(1) average-case lookups using hash functions and collision resolution strategies.

data-structures

Heap Data Structure

intermediate

Learn how binary heaps work as priority queues with O(log n) insertion and O(1) access to the min/max element.

data-structures

Heap Sort

intermediate

Learn how heap sort uses a binary heap to efficiently sort arrays in O(n log n) time with constant extra space.

sorting

Insertion Sort

beginner

Learn how insertion sort builds a sorted array one element at a time by shifting elements into their correct position.

sorting

Linear Search

beginner

The simplest search algorithm: check every element one by one until you find the target or exhaust the array.

searching

Merge Sort

intermediate

Learn how merge sort guarantees O(n log n) performance by dividing, sorting, and merging subarrays.

sorting

Queues

beginner

Learn how the queue data structure works with First-In-First-Out (FIFO) ordering, its variants, and real-world applications.

data-structures

Quick Sort

intermediate

Learn how quicksort's divide-and-conquer strategy works, why pivot selection matters, and when it outperforms mergesort.

sorting

Radix Sort

intermediate

Learn how radix sort achieves linear-time sorting by processing digits from least significant to most significant.

sorting

Selection Sort

beginner

Learn how selection sort finds the minimum element repeatedly and places it in the correct position.

sorting

Shell Sort

intermediate

Learn how Shell sort improves on insertion sort by comparing elements at decreasing gap intervals.

sorting

Sliding Window Technique

intermediate

Learn how the sliding window pattern transforms O(n^2) brute-force solutions into elegant O(n) algorithms for subarray and substring problems.

two-pointers

Stacks

beginner

Learn how the stack data structure works with Last-In-First-Out (LIFO) ordering, its operations, and real-world applications.

data-structures