This project focuses on the implementation and analysis of various data structures and algorithms, with a special emphasis on understanding the time complexity of the Quick Sort algorithm. The repository includes code written in both C++ and Python.
- Implementation of Quick Sort in C++ and Python
- Analysis of Quick Sort time complexity
- Educational examples of data structures and algorithms
- quick_sort.cpp: C++ implementation of the Quick Sort algorithm.
- quick_sort.py: Python implementation of the Quick Sort algorithm.
- .gitattributes: Git configuration file.
- .gitignore: Specifies files to be ignored by Git.
- Clone the repository:
git clone https://github.com/elif1906/Data-structure-and-algorithm.git
- Navigate to the project directory:
cd Data-structure-and-algorithm
- Compile and run the C++ code:
g++ quick_sort.cpp -o quick_sort ./quick_sort
- Run the Python code:
python quick_sort.py
Quick Sort is a highly efficient sorting algorithm and is based on the divide-and-conquer approach. It works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays, according to whether they are less than or greater than the pivot. The sub-arrays are then sorted recursively.
- Best Case: O(n log n)
- Average Case: O(n log n)
- Worst Case: O(n^2)
For more details, visit the GitHub repository.