Skip to content

Implementation of Classic Algorithms in C

Notifications You must be signed in to change notification settings

mKabouri/Classic_Algorithms

Repository files navigation

Classic_Algorithms

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.

Sorting Algorithms

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Radix Sort
  • Heap Sort

Search Algorithms

  • Binary Search
  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)

Graph Algorithms

  • 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

Dynamic Programming

  • Fibonacci Sequence (Memoization and Tabulation)
  • Longest Common Subsequence
  • Knapsack Problem
  • Matrix Chain Multiplication
  • Edit Distance

Data Structures

  • Linked List
  • Stack
  • Queue
  • Binary Search Tree (BST)
  • Hash Table
  • Heap (Min-Heap or Max-Heap)
  • Trie
  • Disjoint-Set (Union-Find)

String Algorithms

  • String Matching (e.g., Knuth-Morris-Pratt, Boyer-Moore)
  • Longest Palindromic Substring
  • Edit Distance (Levenshtein Distance)

Graph Traversal Algorithms

  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)
  • A* Algorithm
  • Bidirectional Search

Geometric Algorithms

  • Convex Hull (e.g., Graham's Scan, Jarvis March)
  • Line Intersection (e.g., Bentley-Ottmann Algorithm)

Numerical Algorithms

  • Newton-Raphson Method (Root Finding)
  • Numerical Integration (e.g., Trapezoidal Rule, Simpson's Rule)

Machine Learning Algorithms (if applicable)

  • Linear Regression
  • Logistic Regression
  • k-Nearest Neighbors (k-NN)
  • Decision Trees
  • Support Vector Machines (SVM)
  • Principal Component Analysis (PCA)
  • k-Means Clustering

Network Algorithms

  • Shortest Path Routing Algorithms (e.g., OSPF, BGP)
  • Max Flow-Min Cut Algorithm (e.g., Ford-Fulkerson)

Cryptography Algorithms

  • Caesar Cipher
  • RSA Encryption/Decryption
  • SHA-256 Hashing

How to Build and Run

To compile and run the algorithms, follow these general steps:

  1. Navigate to the folder of the specific algorithm or data structure you want to build.

  2. Locate the build.sh file in the folder.

  3. Open a terminal or command prompt.

  4. Run the build.sh script by executing the following command:

  5. If the build is successful, an executable file (e.g., test) will be generated in the same folder.

  6. To run the executable, use the following command:

  7. 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.

About

Implementation of Classic Algorithms in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published