DSA Examples
A Simple Algorithm
Finds the 20 first Fibonacci numbers using a for-loop
Finds the 20 first Fibonacci numbers using recursion
Finds the nth Fibonacci number using recursion
A Simple Algorithm Explained
Arrays
Arrays ExplainedBubble Sort
Bubble Sort ExplainedSelection Sort
Selection Sort ExplainedInsertion Sort
Insertion Sort ExplainedQuick Sort
Quick Sort ExplainedCounting Sort
Counting Sort ExplainedRadix Sort
Radix Sort ExplainedMerge Sort
Merge Sort ExplainedLinear Search
Linear Search ExplainedBinary Search
Binary Search ExplainedLinked Lists in Memory
C Example prints memory information
Basic linked list example in C
Basic linked list example in Python and Java
Linked Lists in Memory Explained
Linked Lists Types
Linked Lists Types ExplainedLinked Lists Operations
Traversal of a linked list
Find the lowest value in a linked list
Delete a node in a linked list
Insert a node in a linked list
Linked Lists Operations Explained
Stacks
A very basic Python stack example, only using built-in array operations
Stack data structure
Stack implementation using linked lists
Stacks Explained
Queues
A very basic Python queue example, only using built-in array operations
Queue data structure
Queue implementation using linked lists
Queues Explained
Hash Tables
Hash Tables ExplainedHash Sets
Hash Sets ExplainedHash Maps
Hash Maps ExplainedBinary Trees
Binary Trees ExplainedPre-order Traversal
Pre-order Traversal ExplainedIn-order Traversal
In-order Traversal ExplainedPost-order Traversal
Post-order Traversal ExplainedArray Implementation of Binary Trees
Array Implementation of Binary Trees ExplainedBinary Search Trees
Binary search tree traversal
Searching for a value in a binary search tree
Inserting a node in a binary search tree
Finding the lowest value in a binary search tree
Deleting a node in a binary search tree
Binary Search Trees Explained
AVL Trees
AVL Trees ExplainedGraphs Implementation
A basic undirected graph
Printing the edges in a basic undirected graph
A graph implementation using classes
A directed and weighted graph
Graphs Implementation Explained
Graphs Traversal
Depth First Search Traversal
Breadth First Search Traversal
DFS and BFT traversal of a directed graph
Graphs Traversal Explained
Cycle Detection in Graphs
DFS Cycle Detection for undirected graphs
DFS Cycle Detection for directed graphs
Union Find Cycle Detection
Cycle Detection in Graphs Explained
Dijkstra's Algorithm
Dijkstra's algorithm on an undirected graph
Dijkstra's algorithm on a directed graph
Dijkstra's algorithm, with the shortest paths returned
Dijkstra's algorithm, with a single destination vertex
Dijkstra's Algorithm Explained
The Bellman-Ford Algorithm
The Bellman-Ford algorithm on an undirected graph
The Bellman-Ford algorithm with negative cycle detection
The Bellman-Ford, with the shortest paths returned
The Bellman-Ford Algorithm Explained
Prim's Algorithm
Prim's Algorithm ExplainedKruskal's Algorithm
Kruskal's Algorithm ExplainedThe Ford-Fulkerson Algorithm
The Ford-Fulkerson Algorithm ExplainedThe Edmonds-Karp Algorithm
The Edmond-Karp Algorithm ExplainedThe Eucledian Algorithm
The Eucledian algorithm. Finds the greatest common divisor using division.
The original Eucledian algorithm. Finds the greatest common divisor using subtraction.
The Eucledian Algorithm Explained
Huffman Coding
Huffman Coding ExplainedThe Traveling Salesman Problem
Solving The Traveling Salesman Problem by checking all possible routes (brute force).
Finding a near-optimal solution to the Traveling Salesman Problem using the nearest-neighbor algorithm (greedy).
The Traveling Salesman Explained
The 0/1 Knapsack Problem
Solving the 0/1 Knapsack Problem using recursion and brute force.
Solving the 0/1 Knapsack Problem using memoization.
Solving the 0/1 Knapsack Problem using tabulation.
Solution to the 0/1 Knapsack Problem that also returns the included items.
The 0/1 Knapsack Problem Explained
Memoization
Finding the 6th Fibonacci number with recursion.
Finding the 6th Fibonacci number with recursion together with memoization.
Finding the 30th Fibonacci number, with and without memoization.
Memoization in AVL Trees.
Memoization Explained