Skip to content

imashiqe/algorithm_lab

Repository files navigation

Algorithm Lab

Welcome to the Algorithm Lab repository! This project contains implementations of various algorithms, designed to serve as a resource for learning, reference, and collaboration. Whether you're a student, a developer, or just someone interested in algorithms, you'll find useful code and explanations here.

Algorithms Included

Search Algorithms

  • Linear Search: A simple search algorithm that checks each element of a list until the desired element is found.
  • Binary Search: An efficient algorithm for finding an item from a sorted list of items, reducing the time complexity to O(log n).

Graph Algorithms

  • Breadth-First Search (BFS): An algorithm for traversing or searching tree or graph data structures, starting from the root node and exploring all neighbors at the present depth before moving on to nodes at the next depth level.
  • Depth-First Search (DFS): An algorithm for traversing or searching tree or graph data structures, starting at the root and exploring as far as possible along each branch before backtracking.

Sorting Algorithms

  • Merge Sort: A divide-and-conquer algorithm that splits the array into halves, sorts them, and then merges them back together.
  • Quick Sort: An efficient, in-place, divide-and-conquer sorting algorithm.

Data Structures

  • Heap Algorithm: Implementation of heap data structure and related operations.

Dynamic Programming

  • Rod Cutting Algorithm: An optimization problem that involves cutting a rod into smaller pieces to maximize profit.

Files

  • linear_search.cpp: Implementation of the Linear Search algorithm.
  • binary_search.cpp: Implementation of the Binary Search algorithm.
  • breadth_first_search.cpp: Implementation of the Breadth-First Search algorithm.
  • depth_first_search.cpp: Implementation of the Depth-First Search algorithm.
  • heap_algorithm.cpp: Implementation of the Heap algorithm.
  • merge_sort.cpp: Implementation of the Merge Sort algorithm.
  • quicksort.cpp: Implementation of the Quick Sort algorithm.
  • rod_cutting.cpp: Implementation of the Rod Cutting algorithm.

Contribution Guidelines

We welcome contributions from the community! Here are some ways you can contribute:

  1. Report Bugs: If you find any bugs or issues, please report them using the issue tracker.
  2. Improve Documentation: Help us improve the documentation and make it easier for others to understand the code.
  3. Optimize Code: Suggest optimizations or improvements to the existing implementations.
  4. Add New Algorithms: If there's an algorithm that's not covered here, feel free to implement and submit a pull request.

How to Contribute

  1. Fork the repository on GitHub.
  2. Clone your fork to your local machine using the following command:
    git clone https://github.com/imashiqe/algorithm_lab.git
    
  3. Create a new branch for your feature or bug fix.
  4. Commit your changes with a clear description of what you’ve done.
  5. Push to your branch on GitHub.
  6. Submit a pull request to the main repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.