Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prima Tema

Ce am implementat

  • CountSort
  • BubbleSort
  • InsertionSort
  • RadixSort
  • MergeSort
  • QuickSort

Structura

Sortarile sunt implementate in src/main.cpp.

Fiecare sortare are un input(fisierele src/*.txt). Primul cuvant de pe fiecare linie reprezinta cum sunt generate numerele pentru a fi sortate:

  • random SIZE MAX -> genereaza SIZE numere random in intervalul [0, MAX)
  • shuffled SIZE -> genereaza [0, 1, 2, ..., SIZE - 1] dupa care le amesteca
  • shuffled_rep SIZE -> la fel ca shuffled dar numerele se pot repeta
  • sorted SIZE -> genereaza [0, 1, 2, ..., SIZE - 1]
  • sorted_rep SIZE -> la fel ca sorted dar numerele se pot repeta
  • reversed SIZE -> genereaza [SIZE - 1, ..., 2, 1, 0]
  • reversed_rep SIZE -> la fel ca reversed dar numerele se pot repeta
  • empty -> testeaza pentru []

In src/sort_helper.hpp este codul care face mai usoara implementarea unei noi sortari si afiseaza rezultate aranjate in tabele.

Rulare

Cel mai simplu: rularea single_file/main.cpp cu orice compilator de C++ care suporta C++17(fisierele .txt trebuie sa fie si ele incluse unde se creaza executabilul).

Mai complicat:

cmake -Bbuild -DCMAKE_BUILD_TYPE=Release .
cd build
cmake --build .
cd src/
./Sortari

PS: am testat doar pe linux.

Demo

Could not load PNG :( Could not load PNG :( Could not load PNG :( Could not load PNG :( Could not load PNG :(

About

Sortari

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages