Skip to content

elif1906/Data-structure-and-algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Data Structure and Algorithm

Overview

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.

Features

  • Implementation of Quick Sort in C++ and Python
  • Analysis of Quick Sort time complexity
  • Educational examples of data structures and algorithms

Files

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

Getting Started

  1. Clone the repository:
    git clone https://github.com/elif1906/Data-structure-and-algorithm.git
  2. Navigate to the project directory:
    cd Data-structure-and-algorithm
  3. Compile and run the C++ code:
    g++ quick_sort.cpp -o quick_sort
    ./quick_sort
  4. Run the Python code:
    python quick_sort.py

Quick Sort Algorithm

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.

Time Complexity

  • Best Case: O(n log n)
  • Average Case: O(n log n)
  • Worst Case: O(n^2)

For more details, visit the GitHub repository.

About

Quick sort time complexity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published