Polish version https://www.overleaf.com/read/xvxzgzjjhmpm
This repository was created for the college course needs. It features research on the time complexity of algorithms used in Computer Science.
C++ was chosen as the programming language, in which all presented algorithms were implement.
Compiled executible files are controlled by file with .ini extansion.
- Compiled programs collects data from files.
- The algorithm that is under analysis is being performed.
- From each executed instance, the execution time is measured.
- Measurements are saved to the csv extansion file.
Algorithms [name] | Predicted time complexity [O] |
---|---|
Bubble sort | |
Insertion sort | |
Quick sort | |
Heap sort | |
Counting sort |
In the notebook Sorting Algorithms you will find measurements and diagrams of the written implementations of the algorithms.
shortcut to folder with implementations of sorting algorithms
As in the previous ones, program mst purpose is to measure the execution time of the algorithm. This time there is built a minimum spanning tree, based on Prim's algorithm. Values of edges are taken from file macierz.txt whose content is symmetric matrix created by matlab script MakeGraph.m.
The complexity of the Prim's algorithm depends on the implementation of the queue. However, inside the algorithm we go through all
shortcut to folder with implementations of sorting algorithms
Dijkstra's algorithm finds the shortest paths from a certain vertex to all the paths reached from it. It is an example of a greedy algorithm. The weights of the graph must be non-negative.
The implementation code of Dijkstra's algorithm in this case is array-based. It is not optimal because the search for the minimum value in the loop is linear
shortcut to folder with implementations of sorting algorithms
An AVL tree, also called an admissible tree, is a balanced binary search tree (BST) in which the heights of the left and right subtrees of each node differ by at most one. AVL trees are often compared to red-black trees because they allow the same operations (addition, deletion, and element search) to be performed with equal pessimistic time complexity
shortcut to folder with implementations of sorting algorithms
All writen implementations of algorithms compile successfully by GCC compiler.
Example commands:
- $ g++ main.cpp
- compilation for the external use:
- >g++ -static-libgcc -static-libstdc++ -static -lpthread -o sortowanie.exe main.cpp