The repository is organized around four top-level learning tracks. Keep new work inside these folders instead of adding new root-level directories.
Interactive visualizations live in DSA_Visual_Forge/. This is the only
root-level project folder and is intentionally separated from the C++ practice
tracks because it is a browser application.
Basic Programming Problems/00_Legacy_Practice/01_Introduction/
Data structure Application Problems/00_Overview/01_Arrays/02_Linked_Lists/03_Stacks/04_Queues/05_Trees/06_Graphs/07_Hash_Tables/
Algorithm Application Problems/00_Overview/01_Sorting/02_Searching/03_Graph_Algorithms/04_Minimum_Spanning_Tree/05_Other_Algorithms/
Advanced Programming Problems/01_Shortest_Path/02_Dynamic_Programming/03_Randomized_Algorithms/04_String_Algorithms/
Each data structure or algorithm topic has its own standalone C++17 .cpp file.
Red-black tree implementations are under
Data structure Application Problems/05_Trees/.
- Introduction
- Data Structures
- Algorithms
- Complexity Analysis
- Conclusion
- References
This repository contains a comprehensive collection of data structures and algorithms implemented in various programming languages. This project aims to provide clear and efficient implementations of commonly used data structures and algorithms, along with explanations and analysis of their complexities.
- Description: A collection of elements identified by index or key. They store elements of the same type in contiguous memory locations.
- Operations: Insertion, Deletion, Traversal, Searching.
- Description: A linear data structure where elements, called nodes, are not stored in contiguous memory. Each node contains data and a reference (or link) to the next node.
- Types:
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Operations: Insertion, Deletion, Traversal.
- Description: A linear data structure that follows the Last In First Out (LIFO) principle.
- Operations: Push, Pop, Peek, isEmpty.
- Description: A linear data structure that follows the First In First Out (FIFO) principle.
- Types:
- Simple Queue
- Circular Queue
- Priority Queue
- Operations: Enqueue, Dequeue, Front, isEmpty.
- Description: A tree data structure where each node has at most two children.
- Description: A binary tree where the left subtree contains only nodes with values less than the parent node, and the right subtree only nodes with values greater.
- Description: A self-balancing binary search tree where the height difference between left and right subtrees is at most one.
- Description: A balanced binary search tree with an extra bit for denoting the color of each node (red or black).
- Description: A self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions, and deletions in logarithmic time.
- Description: A tree-like data structure that stores a dynamic set of strings, typically used for searching and prefix matching.
- Description: A graph where the edges have a direction, indicating a one-way relationship.
- Description: A graph where the edges do not have a direction, indicating a two-way relationship.
- Description: A data structure that implements an associative array abstract data type, a structure that can map keys to values.
- Description: A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
- Description: An in-place comparison sorting algorithm that divides the input list into a sorted and an unsorted region and repeatedly selects the smallest element from the unsorted region.
- Description: A simple sorting algorithm that builds a sorted array one element at a time by repeatedly taking the next element and inserting it into the sorted part.
- Description: A divide and conquer algorithm that divides the array into halves, sorts them, and merges them.
- Description: A highly efficient sorting algorithm that uses divide and conquer principles to sort elements.
- Description: A comparison-based sorting technique that utilizes a binary heap data structure.
- Description: A non-comparison sorting algorithm that counts the occurrences of each distinct element.
- Description: Sorts numbers by processing individual digits, using a stable sort as a subroutine.
- Description: Divides the input into several "buckets" and then sorts these buckets individually.
- Description: A simple search algorithm that checks every element in the list until the desired element is found.
- Description: A search algorithm that finds the position of a target value within a sorted array by repeatedly dividing the search interval in half.
- Description: An algorithm for traversing or searching tree or graph data structures that explores as far as possible along each branch.
- Description: An algorithm for traversing or searching tree or graph data structures that explores all neighbor nodes at the present depth before moving on to nodes at the next depth level.
- Description: An algorithm for finding the shortest paths from a starting node to all other nodes in a graph with non-negative edge weights.
- Description: Computes shortest paths from a single source vertex to all other vertices in a graph, capable of handling negative weights.
- Description: A dynamic programming algorithm that finds the shortest paths between all pairs of vertices in a weighted graph.
- Description: An efficient algorithm for finding the shortest paths between all pairs of vertices in a sparse graph, which uses both Bellman-Ford and Dijkstra's algorithms.
- Description: A greedy algorithm that finds a minimum spanning tree for a connected weighted graph.
- Description: A greedy algorithm that builds a minimum spanning tree for a connected weighted graph by adding edges with the minimum weight.
- Description: A property of a problem that can be broken down into smaller, simpler subproblems which can be solved independently.
- Description: An optimization technique that involves storing the results of expensive function calls and returning the cached result when the same inputs occur again.
- Description: A bottom-up approach to dynamic programming that involves filling up a table based on previously computed values.
- Description: A series of numbers where each number is the sum of the two preceding ones, commonly used as an introductory example of dynamic programming.
- Description: A problem in combinatorial optimization where the goal is to determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.
- Description: A classic problem that seeks the longest subsequence present in two sequences.
- Description: A problem that involves determining the most efficient way to multiply a given sequence of matrices.
- Description: An algorithmic technique for solving problems incrementally, one step at a time, and removing those solutions that fail to satisfy the constraints.
- Description: An algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most immediate benefit.
- Description: An algorithm design paradigm that works by recursively breaking down a problem into two or more sub-problems of the same or related type.
- Description: Algorithms that make random choices during their process of execution to produce results.
- Description: An efficient string searching algorithm that avoids unnecessary comparisons.
- Description: A string searching algorithm that uses hashing to find any one of a set of pattern strings in a text.
- Description: A computational complexity that describes the amount of time it takes to run an algorithm as a function of the length of the input.
- Description: A computational complexity that describes the amount of memory space required by an algorithm as a function of the length of the input.
This repository aims to serve as a comprehensive resource for understanding fundamental data structures and algorithms. Each section provides insight into the concepts and their implementations.
- Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.). MIT Press.