All Algorithm & Data Structure Visualizations
- Asteroid Collision Visualization — Simulates asteroid collisions where larger survive, using a stack to process each asteroid in O(n).
- Backspace String Compare Visualization — Simulates backspace characters and compares two strings using two pointers from the end; O(n) time, O(1) space.
- Binary Search Visualization — Eliminates half the search space each step on a sorted array; O(log n).
- Breadth First Search Visualization
- Ceil the Floor Visualization — Finds both floor and ceil of a target in a single binary search pass over a sorted array.
- Count Occurrences of Anagrams Visualization — Counts all anagram occurrences of a pattern in a string using a fixed-size sliding window; O(n).
- Daily Temperatures Visualization — Returns the number of days until a warmer temperature for each day using a monotonic decreasing stack; O(n).
- Delete from Given Index Visualization — Remove the element at a given index by shifting all subsequent elements one position to the left.
- Deletion in Array Visualization — Remove the last element from the array, decreasing its size by one.
- Depth First Search Visualization
- Detect Loop in Linked List Visualization — Detects a cycle in a linked list using Floyd's fast-slow pointer algorithm; O(n) time, O(1) space.
- Flatten Multilevel Doubly Linked List Visualization
- Floor in a Sorted Array Visualization — Finds the largest element ≤ target in a sorted array using binary search with a "last valid" tracker.
- Infix to Postfix Visualization — Converts infix expressions to Reverse Polish Notation using Dijkstra's Shunting-Yard algorithm; O(n).
- Infix to Prefix Visualization — Converts standard infix expressions to prefix (Polish) notation using reversal and the Shunting-Yard algorithm.
- Inorder Traversal Visualization — An inorder traversal first visits the left child (including its entire subtree), then visits the node, and finally visits the right child (including its entire subtree).
- Insert at given index Visualization — Insert a new element at a given index by shifting all subsequent elements one position to the right.
- Insertion Visualization — Add a new element at the end of the array, increasing its size by one.
- Kadane's Algorithm Visualization — Finds the maximum sum contiguous subarray in O(n) by deciding at each step whether to extend or restart.
- Largest Rectangle in Histogram Visualization — Finds the maximum rectangle area in a histogram using a monotonic increasing stack; O(n) time.
- Linked L:ist cycle || Visualization — Finds the node where a cycle begins by resetting one pointer to head after detection; O(n) time, O(1) space.
- LRU Cache Visualization — Evicts the least recently used item in O(1) using a HashMap combined with a doubly linked list.
- Majority Element Visualization
- Max Circular Subarray Sum Visualization — You are given a circular array arr[] of integers, find the maximum possible sum of a non-empty subarray. In a circular array, the subarray can start at the end and wrap around to the beginning. Return the maximum non-empty subarray sum, considering both non-wrapping and wrapping cases.
- Max Sum Subarray of Size K Visualization — Finds the maximum sum of any k consecutive elements using a fixed-size sliding window in O(n).
- Merge Two Sorted Lists Visualization — Merges two sorted linked lists into one sorted list by comparing nodes with a dummy head; O(n+m).
- Middle of Linked List Visualization — Finds the middle node of a linked list in one pass using fast (×2) and slow (×1) pointers.
- Next Greater Element Visualization — Finds the next greater element to the right for each array element using a monotonic decreasing stack; O(n).
- Next Greater Element II Visualization — Finds next greater elements in a circular array by iterating twice with modulo and a monotonic stack; O(n).
- Online Stock Span Visualization — Computes how many consecutive prior days had a price ≤ today using a monotonic stack with accumulated spans; O(1) amortized.
- Palindrome Linked List Visualization — Checks if a linked list is a palindrome by finding the middle, reversing the second half, and comparing.
- Peak Element Visualization — Finds any element strictly greater than its neighbors using binary search; O(log n) even on unsorted arrays.
- Postfix to Infix Visualization — Converts postfix to infix by wrapping each operator application in parentheses using a stack; O(n).
- Postfix to Prefix Visualization — Converts postfix to prefix by pushing operands and combining on operators using a stack; O(n).
- Postorder Traversal Visualization — A postorder traversal first visits the left child (including its entire subtree), then visits the right child (including its entire subtree), and finally visits the node itself.
- Prefix Sum Visualization — Preprocesses cumulative sums so any range sum query can be answered in O(1) after O(n) build time.
- Preorder Traversal Visualization — A preorder traversal first visits the node, then visits the left child (including its entire subtree), and finally visits the right child (including its entire subtree).
- Remove Adjacent Duplicates Visualization — Removes all adjacent duplicate characters repeatedly using a stack; O(n) time and space.
- Remove Duplicates from Sorted List Visualization — Removes consecutive duplicate nodes from a sorted linked list in-place; O(n) time, O(1) space.
- Remove Nth Node From End Visualization — Removes the Nth node from the end of a linked list in one pass using a gap-of-N two-pointer technique.
- Reverse a Doubly Linked List Visualization — Reverses a doubly linked list by swapping prev and next pointers for every node; O(n) time, O(1) space.
- Reverse an array Visualization — Reverse the order of all elements in the array using the two-pointer technique, swapping from both ends inward.
- Reverse a String Visualization — Swaps characters from both ends toward the middle using two pointers; O(n) time, O(1) space.
- Reverse Linked List Visualization — Reverses a singly linked list in-place by relinking pointers; O(n) time, O(1) space.
- Reverse Linked List II Visualization — Reverses only a sublist from position left to right in-place using the head-insertion trick; O(n).
- Rotate List Visualization — Rotates a linked list right by k places by making it circular and cutting at the new tail; O(n).
- Sliding Window Visualization — Maintains a moving subarray window and slides it to avoid recomputing overlapping regions; O(n).
- Sort List Visualization — Sorts a linked list using Merge Sort — find middle, split, sort halves, merge; O(n log n) time, O(log n) space.
- String Basic Operations Visualization — Covers core string primitives — access, concat, substring, search, and split — with their complexity tradeoffs.
- Top K Frequent Elements Visualization — Given a non-empty integer array arr[]. Your task is to find and return the top k elements which have the highest frequency in the array.
- Traversal in Array Visualization — Visit each element of the array one by one from start to end, accessing every index exactly once.
- Two Pointers Visualization — Uses left and right indices moving toward each other to solve pair-sum and partitioning problems in O(n).
- Linear Search Visualization — Scans every element one by one; works on any array but O(n) in the worst case.
- Linked List Visualization — A chain of nodes each holding a value and a pointer to the next; O(1) head insert, O(n) search.
- Longest Nice Substring Visualization — Finds the longest substring where every letter appears in both cases using divide-and-conquer.
- Square Root (x) Visualization — Finds the integer floor of √n without built-in functions using binary search on the answer space.
- Subarray Sum Equals K Visualization — Counts subarrays with sum exactly equal to k using prefix sums and a HashMap; O(n) time and space.
- Two Sum II Visualization — Finds two indices in a sorted array that sum to a target using opposite-end two pointers; O(n) time, O(1) space.
- Valid Palindrome Visualization — Verifies a string reads the same forwards and backwards using the two-pointer technique.
- 3 Sum Visualization — Finds all unique triplets summing to zero by sorting and applying two pointers for each fixed element; O(n²).
- Matrix Block Sum (2D Prefix Sum) Visualization — Computes block sums for every cell in a matrix using 2D prefix sums and the inclusion-exclusion formula; O(m×n).
- Max Consecutive Bit Visualization — Counts the longest run of consecutive 1s in a binary array by resetting a counter on each 0; O(n).
- Maximum Product Subarray Visualization — Finds the maximum product subarray by tracking both max and min products to handle negative flips; O(n).
- Search Insert Position Visualization — Returns the index where a target exists or should be inserted in a sorted array; the lower-bound binary search.
- Sorting Local Choice Visualization — Sort array or select elements to make locally optimal choice and achieve global optimum.
- Valid Palindrome II Visualization — Checks if a string is a palindrome while skipping spaces using two pointers.
- Length of the longest substring Visualization — Finds the longest substring with no repeating characters using a sliding window and hash set; O(n).
- Maximize Number of 1's Visualization — Finds the maximum consecutive 1s achievable by flipping at most k zeros using a variable sliding window; O(n).
- Search in a Rotated Sorted Array Visualization — Searches a rotated sorted array in O(log n) by determining which half is still sorted at each step.
- Sort Colors Visualization — Sorts an array of 0s, 1s, and 2s in one pass using Dijkstra's Dutch National Flag three-pointer algorithm.
- Find Minimum in Rotated Sorted Array Visualization — Finds the minimum element in a rotated sorted array in O(log n) by comparing mid with the right boundary.
- Palindrome Substrings Visualization — Counts all palindromic substrings by expanding around each center; O(n²) time, O(1) space.
- Container With Most Water Visualization — Finds two lines forming the largest water container using two pointers that always move the shorter line inward.
- Move Zeroes to End Visualization — Moves all zeros to the end while preserving relative order of non-zero elements in-place; O(n) time, O(1) space.
- Bubble Sort Visualization — Repeatedly swaps adjacent elements until the array is sorted — simple, O(n²), good for teaching.
- Selection Sort Visualization — Finds the minimum unsorted element and places it at the correct position; always O(n²) comparisons.
- Insertion Sort Visualization — Builds a sorted array one element at a time by inserting each into its correct position; O(n) on nearly-sorted input.
- Merge Sort Visualization — Divides the array in half, sorts each half, then merges — guaranteed O(n log n) and stable.
- Quick Sort Visualization — Picks a pivot, partitions around it, and recursively sorts each side; O(n log n) average, in-place.
- Heap Sort Visualization — Sorting using binary heap data structure
- Counting Sort Visualization — Non-comparison sort using counting
- Radix Sort Visualization — Sort by processing individual digits
- Bucket Sort Visualization — Distribute elements into buckets and sort
- Stack Visualization — Last-In-First-Out structure with O(1) push, pop, and peek; backbone of DFS, expression evaluation, and undo.
- Queue Visualization — First-In-First-Out structure with O(1) enqueue and dequeue; backbone of BFS and task scheduling.
- Binary Search Tree (BST) Visualization — Ordered binary tree where left < node < right; O(log n) average search, insert, and delete.
- Doubly Linked List Visualization — Each node holds prev and next pointers enabling O(1) deletion at any known node and backward traversal.
- Divide and Conquer Visualization — Splits a problem into halves, solves each recursively, and combines results — basis of Merge Sort and Binary Search.
Visualizations
0 visualizations
No visualizations found matching your search.