{"id":19784335,"url":"https://github.com/alexprut/algorithms","last_synced_at":"2025-08-22T11:33:03.306Z","repository":{"id":67790427,"uuid":"39148384","full_name":"alexprut/Algorithms","owner":"alexprut","description":"🍒  Classic Algorithms and Data Structures implemented in C++","archived":false,"fork":false,"pushed_at":"2019-07-14T18:33:25.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T02:49:19.472Z","etag":null,"topics":["algorithms","computer-science","cplusplus"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexprut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-07-15T16:37:42.000Z","updated_at":"2021-05-21T08:32:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"5229c45b-8062-45bc-861b-9397921f3b2f","html_url":"https://github.com/alexprut/Algorithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FAlgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FAlgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FAlgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexprut%2FAlgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexprut","download_url":"https://codeload.github.com/alexprut/Algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241117068,"owners_count":19912474,"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":["algorithms","computer-science","cplusplus"],"created_at":"2024-11-12T06:11:12.721Z","updated_at":"2025-02-28T07:17:50.527Z","avatar_url":"https://github.com/alexprut.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/alexprut/Algorithms/raw/master/logo.png\" width=\"400\" height=\"auto\"/\u003e\n\u003ch1\u003eAlgorithms and Data Structures\u003c/h1\u003e\n\n[![Code Style](https://img.shields.io/badge/code%20style-google-green.svg?style=flat-square)](https://google.github.io/styleguide/cppguide.html)\n[![MIT](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/alexprut/design-patterns-java/blob/master/LICENSE)\n\u003cp\u003eClassic Algorithms and Data Structures implemented in C++\u003c/p\u003e\n\n_Code written for practice. During my Master's degree in Computer Science at the University of Udine._\n\u003c/div\u003e\n\u003cbr /\u003e\n\nAlgorithms Implemented\n======================\n\n|Algorithm|Average Cost|Worst-case Cost|\n|---|---|---|\n|[Insertion Sort](https://github.com/alexprut/Algorithms/blob/master/insertionSort.cpp)|O(n^2)|O(n^2)|\n|[Merge Sort](https://github.com/alexprut/Algorithms/blob/master/mergeSort.cpp)|Θ(nlogn)|Θ(nlogn)|\n|[QuickSort](https://github.com/alexprut/Algorithms/blob/master/quickSort.cpp)|O(nlogn)|O(n^2)|\n|[Counting Sort](https://github.com/alexprut/Algorithms/blob/master/quickSort.cpp)|O(n+k)|O(n+k)|\n|[Binary Search](https://github.com/alexprut/Algorithms/blob/master/binarySearch.cpp)|O(logn)|O(logn)|\n|[Bubble Sort](https://github.com/alexprut/Algorithms/blob/master/bubbleSort.cpp)|O(n^2)|O(n^2)|\n|[Heapsort](https://github.com/alexprut/Algorithms/blob/master/binaryMaxHeap.cpp#L133)|O(nlogn)|O(nlogn)|\n|[Breadth-first Search (BFS)](https://github.com/alexprut/Algorithms/blob/master/breadthFirstSearch.cpp)|O(\\|V\\|+\\|E\\|)|O(\\|V\\|+\\|E\\|)|\n|[Depth-first Search (DFS)](https://github.com/alexprut/Algorithms/blob/master/breadthFirstSearch.cpp)|O(\\|V\\|+\\|E\\|)|O(\\|V\\|+\\|E\\|)|\n|[Prim (MST)](https://github.com/alexprut/Algorithms/blob/master/breadthFirstSearch.cpp)|O(\\|E\\|log\\|V\\|)|O(\\|E\\|log\\|V\\|)|\n|[Kruskal (MST)](https://github.com/alexprut/Algorithms/blob/master/kruskal.cpp)|O(\\|E\\|log\\|V\\|)|O(\\|E\\|log\\|V\\|)|\n|[Bellman-Ford](https://github.com/alexprut/Algorithms/blob/master/bellmanFord.cpp)|O(\\|E\\|\\|V\\|)|O(\\|E\\|\\|V\\|)|\n|[Dijkstra](https://github.com/alexprut/Algorithms/blob/master/dijkstra.cpp)|O(\\|E\\|+\\|V\\|log\\|V\\|)|O(\\|E\\|+\\|V\\|log\\|V\\|)|\n|[Maximum subarray (J.Kadane)](https://github.com/alexprut/Algorithms/blob/master/maxSubArray.cpp)|O(n)|O(n)|\n\nData Structures Implemented\n===========================\n|Data Structure|Methods|\n|--------------|-------|\n|[Linked list](https://github.com/alexprut/Algorithms/blob/master/linkedList.cpp)|```insertFront(int value)``` - O(1), ```deleteFront()``` - O(1), ```isEmpty()``` - O(1)|\n|[Double Linked list](https://github.com/alexprut/Algorithms/blob/master/doubleLinkedList.cpp)|```insertFront(int value)``` - O(1), ```deleteFront()``` - O(1)|\n|[Queue](https://github.com/alexprut/Algorithms/blob/master/queue.cpp)|```enqueue(int value)``` - O(1), ```dequeue()``` - O(1), ```isEmpty()``` - O(1)|\n|[Stack](https://github.com/alexprut/Algorithms/blob/master/stack.cpp)|```pop()``` - O(1), ```push()``` - O(1), ```top()``` - O(1), ```isEmpty()``` - O(1)|\n|[Binary Search Tree (BST)](https://github.com/alexprut/Algorithms/blob/master/binarySearchTree.cpp)|```insert(int value)``` - Θ(logn), ```search(int value)``` - Θ(logn), ```printInOrder()``` - Θ(n), ```printPreOrder()``` - Θ(n), ```printPostOrder()``` - Θ(n)|\n|[Heap (binary max heap)](https://github.com/alexprut/Algorithms/blob/master/binaryMaxHeap.cpp)|```heapify(int index)``` - O(logn), ```insert(int value)``` - O(logn), ```deleteMax()``` - O(logn), ```buildHeap(vector\u003cint\u003e values)``` - O(n), ```heapSort()``` - O(nlogn)|\n|[Heap (binary min heap)](https://github.com/alexprut/Algorithms/blob/master/binaryMaxHeap.cpp)|```heapify(int index)``` - O(logn), ```insert(int value)``` - O(logn), ```deleteMin()``` - O(logn), ```buildHeap(vector\u003cint\u003e values)``` - O(n), ```heapSort()``` - O(nlogn)|\n|[Disjoint Set](https://github.com/alexprut/Algorithms/blob/master/disjointSet.cpp)|```makeSet()``` - Θ(1), ```findSet()``` - Θ(1), ```union()``` - Θ(1)|\n|[Trie](https://github.com/alexprut/Algorithms/blob/master/trie.cpp)|```add()``` - O(\\|string\\|), ```find()``` - O(\\|string\\|)|\n\nLicense\n=======\nLicensed under [MIT](https://github.com/alexprut/Algorithms/blob/master/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexprut%2Falgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexprut%2Falgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexprut%2Falgorithms/lists"}