{"id":18777679,"url":"https://github.com/shilongdai/datastructures","last_synced_at":"2026-07-22T14:32:51.471Z","repository":{"id":89673147,"uuid":"158731529","full_name":"shilongdai/DataStructures","owner":"shilongdai","description":"Implementation of classic data structures and algorithms","archived":false,"fork":false,"pushed_at":"2020-09-07T20:04:29.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-23T23:49:04.063Z","etag":null,"topics":["algorithms","algorithms-4th","algorithms-and-data-structures","algorithms-datastructures","algorithms-implemented","algorithms-princeton","algorithms-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shilongdai.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,"zenodo":null}},"created_at":"2018-11-22T17:21:14.000Z","updated_at":"2020-09-07T20:04:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e96e233-062f-4c51-900a-541223d8d14d","html_url":"https://github.com/shilongdai/DataStructures","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shilongdai/DataStructures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilongdai%2FDataStructures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilongdai%2FDataStructures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilongdai%2FDataStructures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilongdai%2FDataStructures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shilongdai","download_url":"https://codeload.github.com/shilongdai/DataStructures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilongdai%2FDataStructures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35766428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-22T02:00:06.236Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","algorithms-4th","algorithms-and-data-structures","algorithms-datastructures","algorithms-implemented","algorithms-princeton","algorithms-python"],"created_at":"2024-11-07T20:13:16.256Z","updated_at":"2026-07-22T14:32:51.439Z","avatar_url":"https://github.com/shilongdai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataStructures\nThis library provides implementations of classic algorithms and datastructures. \n\n# Organization\nThe project is divided into two packages, algorithms and structure. The algorithms package contains implementations of mostly stand alone algorithms while the structure package contains data structures and algorithms that exclusively operates on them.\n\n## Algorithms\nHere is a list of algorithms under the algorithms package:\n\nIn binarySearch.py:\n\n- standard binary search: the standard binary search. https://en.wikipedia.org/wiki/Binary_search_algorithm\n- first occurence binary search: the standard binary search except that it finds the first element that matches the search key.\n\nIn expression.py:\n\n- Shunting yard algorithm: Dijkstra's algorithm for converting infix to postfix notation. https://en.wikipedia.org/wiki/Shunting-yard_algorithm\n\n- Dijkstra's two stack algorithm: Dijkstra's algorithm for interpreting postfix expressions.\n\nIn problemSolver.py:\n\n- A* algorithm: A path finding algorithm. https://en.wikipedia.org/wiki/A*_search_algorithm\n- A* algorithm adapted to the 8-puzzle problem: https://www.cs.princeton.edu/courses/archive/spr10/cos226/assignments/8puzzle.html\n\nIn sort.py:\n\n- Selection sort: https://en.wikipedia.org/wiki/Selection_sort\n- Insertion sort: https://en.wikipedia.org/wiki/Insertion_sort\n- Shell sort: https://en.wikipedia.org/wiki/Shellsort\n- Variations of Merge sort: https://en.wikipedia.org/wiki/Merge_sort\n- Inversion count: Count the number of inversions with modified merge sort\n- Variations of Quick sort: Including standard quick sort, 3-way quick sort, and sampling quick sort. https://en.wikipedia.org/wiki/Quicksort\n- Heap sort: https://en.wikipedia.org/wiki/Heapsort\n- Select kth: select the kth element in order. Based on the quick sort partition.\n\n## Structure\nHere is a list of implemented data structures and algorithms that operates on them:\n\nIn linkedList.py:\n\n- Linked list: https://en.wikipedia.org/wiki/Linked_list\n- Linked stack: Stack implemented with a Linked List.\n- Linked queue: Queue implemented with a Linked List.\n\nIn unionFind.py: https://en.wikipedia.org/wiki/Disjoint-set_data_structure\n\n- Quick Find: Disjoint set implemented with array like data structure. O(1) find.\n- Quick Union: Disjoint set implemented with parent link tree.\n- Balanced Quick Union: Disjoint set implemented with parent link tree and balancing on union. O(log(N)) efficiency for find and union.\n- Path Compression Quick Union: Disjoint set implemented with parent link tree and augmented with path compression.\n- Balanced Path Compression Quick Union: Disjoint set implemented with parent link tree with balancing and path compression. almost amortized O(1) efficiency on find and union.\n\nIn symbolTable.py:\n\n- Binary Search Tree: Standard BST. https://en.wikipedia.org/wiki/Binary_search_tree\n- Red \u0026 Black Tree: Balanced BST using 2-3 representation. https://en.wikipedia.org/wiki/Red%E2%80%93black_tree\n- Separate Chaining Hash Table: Hash table that resolve collision by chaining them in a list. https://en.wikipedia.org/wiki/Hash_table#Separate_chaining\n- Open Address Hash Table: Hash table that resolve collision with linear probing. https://en.wikipedia.org/wiki/Hash_table#Open_addressing\n\nIn heap.py:\n\n- Binary Heap: An implementation of a priority queue with binary heap. https://en.wikipedia.org/wiki/Binary_heap\n\nIn graph.py:\n\n- Undirected Graph: https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)#Undirected_graph\n- Directed Graph: https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)#Directed_graph\n- Undirected Weighted Graph: https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)#Weighted_graph\n- Directed Weighted Graph: https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)#Weighted_graph\n- Depth First Search: https://en.wikipedia.org/wiki/Depth-first_search\n- Breadth First Search: https://en.wikipedia.org/wiki/Breadth-first_search\n- Undirected Connected Components: https://en.wikipedia.org/wiki/Component_(graph_theory)\n- Undirected Cycle Detection: https://en.wikipedia.org/wiki/Cycle_(graph_theory)\n- Directed Cycle Detection: https://en.wikipedia.org/wiki/Cycle_(graph_theory)\n- Biparte Detection: https://en.wikipedia.org/wiki/Bipartite_graph\n- Topological Ordering: https://en.wikipedia.org/wiki/Topological_sorting\n- Strongly Connected Components(Kosaraju's algorithm): https://en.wikipedia.org/wiki/Kosaraju%27s_algorithm\n- Prim's Algorithm(Lazy): https://en.wikipedia.org/wiki/Prim%27s_algorithm\n- Kruskal's Algorithm: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n- Dijkstra's Shortest Path: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n- Topological Acyclic Shortest Path: https://en.wikipedia.org/wiki/Topological_sorting#Application_to_shortest_path_finding\n- Bellman Ford Shortest path: https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm\n\n# Usage\nAll of the components are tested. However, they are not tested to rigorous production standards. Data structures such as the linked list and symbolTables have interfaces like the standard python list and dictionary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshilongdai%2Fdatastructures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshilongdai%2Fdatastructures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshilongdai%2Fdatastructures/lists"}