{"id":23196519,"url":"https://github.com/jeepway/data-structures-in-c","last_synced_at":"2026-02-14T03:13:37.210Z","repository":{"id":264645906,"uuid":"893482255","full_name":"JeepWay/data-structures-in-C","owner":"JeepWay","description":"A collection of implementations of commonly used data structures in C.","archived":false,"fork":false,"pushed_at":"2025-01-03T10:02:02.000Z","size":85,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T11:19:30.971Z","etag":null,"topics":["algorithms","c","c-programming","data-structures","data-structures-in-c","dsa","makefile"],"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/JeepWay.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":"2024-11-24T15:06:18.000Z","updated_at":"2025-01-03T10:02:05.000Z","dependencies_parsed_at":"2024-12-25T16:19:48.931Z","dependency_job_id":"771054b5-62b9-4f3c-a596-ed6e1799a2f2","html_url":"https://github.com/JeepWay/data-structures-in-C","commit_stats":null,"previous_names":["jeepway/data-structures-in-c"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeepWay%2Fdata-structures-in-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeepWay%2Fdata-structures-in-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeepWay%2Fdata-structures-in-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeepWay%2Fdata-structures-in-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeepWay","download_url":"https://codeload.github.com/JeepWay/data-structures-in-C/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238152348,"owners_count":19425075,"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","c","c-programming","data-structures","data-structures-in-c","dsa","makefile"],"created_at":"2024-12-18T14:18:59.113Z","updated_at":"2025-10-25T13:31:40.096Z","avatar_url":"https://github.com/JeepWay.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structures in C\n![License](https://img.shields.io/github/license/JeepWay/data-structures-in-C)\n![Language](https://img.shields.io/badge/Language-C-blue)\n\nThis repository contains implementations of various data structures in C, based on the concepts and examples presented in the book [\"Fundamentals of Data Structures in C\"](https://caucse.club/wp-content/uploads/2022/05/Fundamentals-of-Data-Structures-in-C-Ellis-Horowitz-Sartaj-Sahni-etc.-.pdf) by Ellis Horowitz, Sartaj Sahni, and Susan Anderson-Freed.\n\nEach data structure is implemented in a separate directory, with a `main.c` file that demonstrates the usage of the data structure. For example, the stack of general data type using arrays is in the [`stack/general_stack`](https://github.com/JeepWay/data-structures-in-C/tree/main/stack/general_stack) directory, with the [`main.c`](https://github.com/JeepWay/data-structures-in-C/blob/main/stack/general_stack/main.c) file demonstrating the usage of the stack.\n\nThe [`Makefile`](https://github.com/JeepWay/data-structures-in-C/blob/main/Makefile) in the root directory can be used to compile and run the demo programs for each data structure according to the `TARGET` specified, you can find them in the [usage section](https://github.com/JeepWay/data-structures-in-C?tab=readme-ov-file#makefile-usage) below.\n\n## Table of Contents\n- **[Stacks](https://github.com/JeepWay/data-structures-in-C/tree/main/stack)**\n  - Stack using Arrays (general) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/stack/general_stack)\n  - Stack using Arrays (int) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/stack/int_stack)\n- **[Queues](https://github.com/JeepWay/data-structures-in-C/tree/main/queue)**\n  - Queue using Arrays with N-1 slots (general) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/queue/general_circular_array_n-1_slot_queue)\n  - Queue using Arrays with N slots (int) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/queue/general_circular_array_n_slot_queue)\n  - Circular Queue using Single Linked List [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/queue/general_single_list_queue)\n- **[Linked Lists](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list)**\n  - Singly Linked List (grneral) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list/general_single_list)\n  - Singly Linked List (int) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list/int_single_list)\n  - Doubly Linked Lists (grneral) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list/general_double_list)\n  - Doubly Linked Lists (int) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list/int_double_list)\n- **[Trees](https://github.com/JeepWay/data-structures-in-C/tree/main/tree)**\n  - Binary Trees [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/tree/binary_tree)\n  - Binary Search Trees [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/tree/binary_search_tree)\n- **[Sets](https://github.com/JeepWay/data-structures-in-C/tree/main/set)**\n  - Disjoint Sets [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/set/disjoint_set)\n- **[Graphs](https://github.com/JeepWay/data-structures-in-C/tree/main/graph)**\n  - BFS [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/graph/bfs)\n  - DFS [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/graph/dfs)\n  - Kruskal's Minimum Spanning Tree [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/graph/Kruskal_mst)\n- **[Hashing](https://github.com/JeepWay/data-structures-in-C/tree/main/hashing)**\n  - Hash Table using Linked List [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/hashing/hashtable_list)\n  - Hash Table using Arrays [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/hashing/hashtable_array)\n- **[Heap Structures](https://github.com/JeepWay/data-structures-in-C/tree/main/heap)**\n  - Min Heap (general) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/general_min_heap)\n  - Min Heap (int) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/int_min_heap)\n  - Max Heap (int) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/int_max_heap)\n  - Min-Max Heap (general) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/general_min_max_heap)\n  - Deap (general) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/general_deap)\n  - Min Leftist Tree (general) [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/general_min_leftist_tree)\n  - Binoimial Heap [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/binomial_heap)\n  - Fibonacci Heap [📂](https://github.com/JeepWay/data-structures-in-C/tree/main/heap/fibonacci_heap)\n\n## Makefile Usage\n### Stacks\n* Stack of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/stack/general_stack/main.c)\n    ```bash\n    make test TARGET=general_stack\n    ```\n* Stack of `integer` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/stack/int_stack/main.c)\n    ```bash\n    make test TARGET=int_stack\n    ```\n### Queues\n* Queue of `general` data type using arrays with N-1 slots [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/queue/general_circular_array_n-1_slot_queue/main.c)\n    ```bash\n    make test TARGET=general_circular_array_n-1_slot_queue\n    ```\n* Queue of `general` data type using arrays with N slots [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/queue/general_circular_array_n_slot_queue/main.c)\n    ```bash\n    make test TARGET=general_circular_array_n_slot_queue\n    ```\n* Circular of `general` data type using single linked list [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/queue/general_single_list_queue/main.c)\n    ```bash\n    make test TARGET=general_single_list_queue\n    ```\n### Linked Lists\n* Singly linked list of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list/general_single_list/main.c)\n    ```bash\n    make test TARGET=general_single_linked_list\n    ```\n* Singly linked list of `integer` data type [📃](https://github.com/JeepWay/data-structures-in-C/tree/main/linked_list/int_single_list/main.c)\n    ```bash\n    make test TARGET=int_single_linked_list\n    ```\n* Doubly linked list of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/linked_list/general_double_list/main.c)\n    ```bash\n    make test TARGET=general_double_linked_list\n    ```\n* Doubly linked list of `integer` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/linked_list/int_double_list/main.c)\n    ```bash\n    make test TARGET=int_double_linked_list\n    ```\n### Trees\n* Binary tree [📃](https://github.com/JeepWay/data-structures-in-C/tree/main/tree/binary_tree/main.c)\n    ```bash\n    make test TARGET=binary_tree\n    ```\n* Binary search tree [📃](https://github.com/JeepWay/data-structures-in-C/tree/main/tree/binary_search_tree/main.c)\n    ```bash\n    make test TARGET=binary_search_tree\n    ```\n### Sets\n* Disjoint sets [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/set/disjoint_set/main.c)\n    ```bash\n    make test TARGET=disjoint_set\n    ```\n### Graphs\n* BFS [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/graph/bfs/main.c)\n    ```bash\n    make test TARGET=graph_bfs\n    ```\n* DFS [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/graph/dfs/main.c)\n    ```bash\n    make test TARGET=graph_dfs\n    ```\n* Kruskal's Minimum Spanning Tree [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/graph/Kruskal_mst/main.c)\n    ```bash\n    make test TARGET=Kruskal_mst\n    ```\n### Hashing\n* Hash table using linked list [📃](https://github.com/JeepWay/data-structures-in-C/tree/main/hashing/hashtable_list/main.c)\n    ```bash\n    make test TARGET=hashtable_list\n    ```\n* Hash table using arrays [📃](https://github.com/JeepWay/data-structures-in-C/tree/main/hashing/hashtable_array/main.c)\n    ```bash\n    make test TARGET=hashtable_array\n    ```\n  * If collision occurs during insertion, the key is inserted into the next available slot according to linear probing.\n### Heap Structures\n* Min heap of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/general_min_heap/main.c)\n    ```bash\n    make test TARGET=general_min_heap\n    ```\n* Min heap of `integer` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/int_min_heap/main.c)\n    ```bash\n    make test TARGET=int_min_heap\n    ```\n* Max heap of `integer` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/int_max_heap/main.c)\n    ```bash\n    make test TARGET=int_max_heap\n    ```\n* Min-max heap of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/general_min_max_heap/main.c)\n    ```bash\n    make test TARGET=general_min_max_heap\n    ```\n* Deap of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/general_deap/main.c)\n    ```bash\n    make test TARGET=general_deap\n    ```\n* Min leftist tree of `general` data type [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/general_min_leftist_tree/main.c)\n    ```bash\n    make test TARGET=general_min_leftist_tree\n    ```\n* Binomial heap [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/binomial_heap/main.c)\n    ```bash\n    make test TARGET=binomial_heap\n    ```\n* Fibonacci heap [📃](https://github.com/JeepWay/data-structures-in-C/blob/main/heap/fibonacci_heap/main.c)\n    ```bash\n    make test TARGET=fibonacci_heap\n    ```\n### Clean up object and executable files\n```bash\nmake clean\n```\n\n## Acknowledgments\nInspired by and references from:\n* [bartobri/data-structures-c](https://github.com/bartobri/data-structures-c)\n* [AnishLohiya/DSA](https://github.com/AnishLohiya/DSA)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeepway%2Fdata-structures-in-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeepway%2Fdata-structures-in-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeepway%2Fdata-structures-in-c/lists"}