Welcome to the Algorithms ! This project contains implementations of various algorithms in C++.
This repository contains a collection of algorithm implementations in C++. The goal of this project is to provide clear and efficient implementations of common algorithms used in computer science.
The project is organized as follows:
.
├── .gitattributes
├── .gitignore
├── Algorithms.sln
├── Algorithms.vcxproj
├── Algorithms.vcxproj.filters
├── BinarySearch.cpp
├── Fibonacci.cpp
├── LinearSearch.cpp
├── binarysearch.h
├── linearsearch.h
└── main.cpp
.gitattributes
and.gitignore
: Configuration files for git.Algorithms.sln
: Solution file for the project.Algorithms.vcxproj
andAlgorithms.vcxproj.filters
: Project files.BinarySearch.cpp
andbinarysearch.h
: Implementation and header files for the Binary Search algorithm.Fibonacci.cpp
: Implementation of the Fibonacci sequence algorithm.LinearSearch.cpp
andlinearsearch.h
: Implementation and header files for the Linear Search algorithm.main.cpp
: The main file to run and test the algorithms.
-
Binary Search
BinarySearch.cpp
binarysearch.h
- Binary search is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item until you've narrowed down the possible locations to just one.
-
Fibonacci Sequence
Fibonacci.cpp
- This algorithm generates the Fibonacci sequence, where each number is the sum of the two preceding ones, starting from 0 and 1.
-
Linear Search
LinearSearch.cpp
linearsearch.h
- Linear search is a simple algorithm that checks every element in the list until the target value is found or the list ends.
To run this project, you need:
- A C++ compiler (e.g., g++, clang)
-
Clone the repository:
git clone https://github.com/EchoSingh/algorithms.git cd algorithms
-
Compile the code:
g++ -o algorithms main.cpp BinarySearch.cpp Fibonacci.cpp LinearSearch.cpp
-
Run the executable:
./algorithms
This project is licensed under the MIT License - see the LICENSE file for details.