{"id":20762692,"url":"https://github.com/Mt1Gr/Data_structures_and_computional_complexity","last_synced_at":"2025-05-11T08:33:37.851Z","repository":{"id":259590020,"uuid":"469163684","full_name":"Mt1Gr/Data_structures_and_computional_complexity","owner":"Mt1Gr","description":"Research on computational complexity of algorithms and data structures","archived":false,"fork":false,"pushed_at":"2022-06-25T21:08:16.000Z","size":37299,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T17:54:25.445Z","etag":null,"topics":["avl-tree","cpp","data-structures","mst-tree","research-project","shortest-path","sorting-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mt1Gr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-12T18:13:16.000Z","updated_at":"2023-04-22T14:37:43.000Z","dependencies_parsed_at":"2024-10-27T00:22:02.910Z","dependency_job_id":null,"html_url":"https://github.com/Mt1Gr/Data_structures_and_computional_complexity","commit_stats":null,"previous_names":["imoneo/data_structures_and_computional_complexity","sejq/data_structures_and_computional_complexity","mt1gr/data_structures_and_computional_complexity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mt1Gr%2FData_structures_and_computional_complexity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mt1Gr%2FData_structures_and_computional_complexity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mt1Gr%2FData_structures_and_computional_complexity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mt1Gr%2FData_structures_and_computional_complexity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mt1Gr","download_url":"https://codeload.github.com/Mt1Gr/Data_structures_and_computional_complexity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253540418,"owners_count":21924521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avl-tree","cpp","data-structures","mst-tree","research-project","shortest-path","sorting-algorithms"],"created_at":"2024-11-17T10:37:54.070Z","updated_at":"2025-05-11T08:33:33.021Z","avatar_url":"https://github.com/Mt1Gr.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data structures and computional complexity\n\nPolish version [https://www.overleaf.com/read/xvxzgzjjhmpm](https://www.overleaf.com/read/xvxzgzjjhmpm)\n\nThis repository was created for the college course needs. It features research on the time complexity of algorithms used in Computer Science.\n\nC++ was chosen as the programming language, in which all presented algorithms were implement.\n\nCompiled executible files are controlled by file with .ini extansion.\n\n## Reasearch method\n\n1. Compiled programs collects data from files.\n1. The algorithm that is under analysis is being performed.\n    - From each executed instance, the execution time is measured.\n1. Measurements are saved to the csv extansion file.\n\n## Time complexity of sorting algorithms\n\n### Discussed Algorithms\n\n| Algorithms [name] | Predicted time complexity [O] |\n|:-----------------:|:-------------------:|\n|    Bubble sort    |        $n^2$        |\n|   Insertion sort  |        $n^2$        |\n|     Quick sort    |       $n*logn$      |\n|     Heap sort     |       $n*logn$      |\n|   Counting sort   |        $n+k$        |\n\nIn the notebook Sorting Algorithms you will find measurements and diagrams of the written implementations of the algorithms.\n\n![Bubble, Insertion, Quick sorts graph](/images/quick_bubble_insert.png)\n![Count, Heap sorts graph](/images/count_heap.png)\n\n[shortcut to ipynb notebook](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/notebooks/sorting_algorithms.ipynb)\n\n[shortcut to folder with implementations of sorting algorithms](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/sorting_algorithms)\n\n## Minimum spanning tree (MST)\n\nAs 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*.\n\nThe complexity of the Prim's algorithm depends on the implementation of the queue. However, inside the algorithm we go through all $n$ elements of the queue and update $n$ neighbors each time. This means that the algorithm itself has a complexity of $n^2$.\n\n[shortcut to ipynb notebook](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/notebooks/prim_algo.ipynb)\n\n[shortcut to folder with implementations of sorting algorithms](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/mst_tree)\n\n## Dijkstra shortest path (heap)\n\nDijkstra'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.\nThe 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 $O(n)$ by which the algorithm eventually achieves a quadratic complexity of $O(n^2)$.\n\n[shortcut to ipynb notebook](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/notebooks/dijkstra_shortest_path.ipynb)\n\n[shortcut to folder with implementations of sorting algorithms](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/shortest_path)\n\n## Building AVL tree\n\nAn 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 $O(log n)$. Building this type of tree will therefore be done with time complexity $O(nlogn)$.\n\n[shortcut to ipynb notebook](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/notebooks/avl_tree.ipynb)\n\n[shortcut to folder with implementations of sorting algorithms](https://github.com/colonelWalterKurtz/Data_structures_and_computional_complexity/tree/master/avl_trees)\n\n## Compilation\n\nAll writen implementations of algorithms compile successfully by ***GCC*** compiler.\n\nExample commands:\n\n- *$ g++ main.cpp*\n- compilation for the external use:\n  - ***\u003eg++ -static-libgcc -static-libstdc++ -static -lpthread -o sortowanie.exe main.cpp***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMt1Gr%2FData_structures_and_computional_complexity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMt1Gr%2FData_structures_and_computional_complexity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMt1Gr%2FData_structures_and_computional_complexity/lists"}