Skip to content

arpanmukherjee/Data-Structures-and-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms

Following are the codes of all the data-structures and algorithms I have learned till now. I implemented all of them in C++. I will also try to add all the resources I have learnt from. I used to practice competitive programming on all the popular websites and I tried to maintain all the codes to a repo. You can find it here. Thank you. Enjoy.

Quick Links

Searching and Sorting

Searching

Algorithm Code
Linear Search C++
Binary Search C++

Sorting

Algorithm Code
Selection Sort C++
Bubble Sort C++
Insertion Sort C++
Merge Sort C++
Quick Sort C++

Dynamic Programming

Problem Code
Kadane's Algorithm C++
Longest Increasing Subsequence C++
Longest Common Subsequence C++
Edit Distance C++
Subset Sum Problem C++
Minimum No of Coins C++
Maximum sum Problem C++
Egg Dropping Puzzle C++
Form a palindrome C++

Range Minimum Query

Problem Code
Sparse Table C++
Segment Tree C++
Binary Indexed Tree (Fenwick) C++

Data Structures

Problem Code
Heap / Priority Queue C++ #
Disjoint Set Union (Union Find) C++
Segment Tree C++
Binary Indexed Tree (Fenwick) C++
Trie C++ #
Suffix Tree C++ #
Suffix Array C++ #
Sparse Table C++

Graphs

Garph Traversal

Problem Code
Breadth First Search C++
Depth First Search Iterative C++
Depth First Search Recursive C++
Topological Sort C++

Cycle Detection

Problem Code
Cycle Detection Undirected Graph (DFS) C++
Cycle Detection Undirected Graph (DSU) C++
Cycle Detection Directed Graph (DFS) C++

Minimum Spanning Tree

Problem Code
Prim's Algorithm C++
Kruskal C++ #
Kruskal with Disjoint Set C++

Single Source Shortest Paths

Problem Code
Shortest path using BFS C++
Dijkstra’s SSSP C++
Bellman–Ford C++ #

All Source Shortest Paths

Problem Code
Floyd-Warshall C++

Connectivity

Problem Code
Articulation Point (Tarjan) C++
Strongly Connected Components (Kosaraju) C++

Trees

Tree Traversal

Problem Code
Inorder Recursive Traversal C++
Inorder Iterative Traversal C++
Preorder Traversal C++
Postorder Traversal C++

LCA

Problem Code
LCA (Binary Tree) C++
LCA (Euler tour + SegTree) C++
LCA (Binary Lifting) C++

Strings

Problem Code
KMP Algorithm C++ #
Z Algorithm C++ #