This repository contains implementations of various algorithms and data structures in C. Each algorithm is organized into folders, and there's a build.sh file in each folder to compile and run the code.
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Radix Sort
- Heap Sort
- Binary Search
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
- Dijkstra's Algorithm (Shortest Path)
- Kruskal's Algorithm (Minimum Spanning Tree)
- Floyd-Warshall Algorithm (All Shortest Paths)
- Topological Sort
- Depth-First and Breadth-First Traversal
- Fibonacci Sequence (Memoization and Tabulation)
- Longest Common Subsequence
- Knapsack Problem
- Matrix Chain Multiplication
- Edit Distance
- Linked List
- Stack
- Queue
- Binary Search Tree (BST)
- Hash Table
- Heap (Min-Heap or Max-Heap)
- Trie
- Disjoint-Set (Union-Find)
- String Matching (e.g., Knuth-Morris-Pratt, Boyer-Moore)
- Longest Palindromic Substring
- Edit Distance (Levenshtein Distance)
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
- A* Algorithm
- Bidirectional Search
- Convex Hull (e.g., Graham's Scan, Jarvis March)
- Line Intersection (e.g., Bentley-Ottmann Algorithm)
- Newton-Raphson Method (Root Finding)
- Numerical Integration (e.g., Trapezoidal Rule, Simpson's Rule)
- Linear Regression
- Logistic Regression
- k-Nearest Neighbors (k-NN)
- Decision Trees
- Support Vector Machines (SVM)
- Principal Component Analysis (PCA)
- k-Means Clustering
- Shortest Path Routing Algorithms (e.g., OSPF, BGP)
- Max Flow-Min Cut Algorithm (e.g., Ford-Fulkerson)
- Caesar Cipher
- RSA Encryption/Decryption
- SHA-256 Hashing
To compile and run the algorithms, follow these general steps:
-
Navigate to the folder of the specific algorithm or data structure you want to build.
-
Locate the
build.sh
file in the folder. -
Open a terminal or command prompt.
-
Run the
build.sh
script by executing the following command: -
If the build is successful, an executable file (e.g.,
test
) will be generated in the same folder. -
To run the executable, use the following command:
-
Follow any on-screen instructions or input requirements specific to the algorithm.
Note: Ensure you have a C compiler (e.g., GCC) installed on your system before attempting to build the code. You may need to install development tools or libraries depending on the algorithm's requirements.
Feel free to refer to the individual algorithm folders for more detailed build and usage instructions.