Skip to content

mikolajek22/cpp_algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures, Algorithms & ADT Playbench

Implementation and visualization of sorting algorithms in C++ and Python, Sorting Algorithms and Abstract Data Types. Algorithms as c++ templates.

Abstract Data Types

  1. Queue
  2. Ring Queue
  3. Stack
  4. Linked List Stack
  5. Binary Tree

Searching Algorithms

Algorithm avg time worst time best time space
Linear Search O(n) O(n) O(1) O(1)
Binary Search O(log(n)) OO(log(n)) O(1) O(1)

Sorting Algorithms

Algorithm avg time worst time best time space
Bubble Sort O(n2) O(n2) O(n) O(1)
Selection Sort O(n2) O(n2) O(n2) O(1)
Insertion Sort O(n2) O(n2) O(n) O(1)
Merge Sort O(nlog(n)) O(nlog(n)) O(nlog(n)) O(n)
Quick Sort O(nlog(n)) O(n2) O(nlog(n)) O(log(n))
Heap Sort O(nlog(n)) O(nlog(n)) O(nlog(n)) O(log(n))

Build Sequence

Algorithms and ADT

  1. Get Google Test lib: sudo apt install libgtest-dev
  2. Create and go to /build (from main folder):
    mkdir build
    cd build
  1. Generate build files: cmake ..
  2. Compie: make
  3. Available tests:
    ./adt_test
    ./searching_test`
    ./sorting_test

Plots

  1. Venv Build:
    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  1. Navigate to Tests/sorting: cd Tests/sorting
  2. Run Python script: python timeComparement.py
  3. Plots are in: Tests/sorting/data

About

C++ algorithms sorting comparison, c++ templates for sorting and searching algorithms

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors