{"id":19599154,"url":"https://github.com/lanstobias/circular-queue","last_synced_at":"2025-08-09T12:41:02.123Z","repository":{"id":169183744,"uuid":"132425960","full_name":"lanstobias/circular-queue","owner":"lanstobias","description":"Implementation of a circular queue in c","archived":false,"fork":false,"pushed_at":"2018-05-07T08:30:31.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T07:50:33.142Z","etag":null,"topics":["adt","c","circular-queue","linux","queue"],"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/lanstobias.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":"2018-05-07T07:50:52.000Z","updated_at":"2020-11-08T07:49:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d55bf86-1a10-4f0a-860a-7216b31f355b","html_url":"https://github.com/lanstobias/circular-queue","commit_stats":null,"previous_names":["lanstobias/circular-queue"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanstobias%2Fcircular-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanstobias%2Fcircular-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanstobias%2Fcircular-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanstobias%2Fcircular-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanstobias","download_url":"https://codeload.github.com/lanstobias/circular-queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240876854,"owners_count":19871903,"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":["adt","c","circular-queue","linux","queue"],"created_at":"2024-11-11T09:09:08.844Z","updated_at":"2025-02-26T15:17:21.759Z","avatar_url":"https://github.com/lanstobias.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Circular Queue implementation in C\n\n## Design\nHere's the internal structure of the datatype\n```c\ntypedef struct\n{\n    int rear, front;\n    int* array;\n    int size;\n    int nrOfElements;\n} queue;\n```\n\nMethods\n```c\nint queueDequeue(queue* self);\nint queueEnqueue(queue* self, int value);\nvoid queueClear(queue* self);\nint queueIsFull(queue* self);\nint queueIsEmpty(queue* self);\nint queueSize(queue* self);\nint queueFirst(queue* self);\nint queueLast(queue* self);\n```\n\n## Usage\n```c\n// Create queue object\nqueue queue;\n\n// Initialize the queue with given size\nqueueInit(\u0026queue, 100);\n\n// Add values to the queue\nqueueEnqueue(\u0026queue, 2);\nqueueEnqueue(\u0026queue, 4);\nqueueEnqueue(\u0026queue, 6);\n\n// Get first in queue\nint dequeueVal = queueDequeue(\u0026queue); // \u003c-- 2\n```\n\n## Tests\nThere are tests for all methods. To create the executable tests file, run the make command\n```shell\n$ make tests\n```\n\nYou can then execute the test file as shown below\n```\n$ ./tests\nTesting newQueue().. passed!\nTesting queueSize().. passed!\nTesting queueEnqueue().. passed!\nTesting queueDequeue().. passed!\nTesting queueClear().. passed!\nTesting queueFirst().. passed!\nTesting queueLast().. passed!\nTesting queueIsFull().. passed!\nTesting queueIsEmpty().. passed!\n\nAll tests passed! :)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanstobias%2Fcircular-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanstobias%2Fcircular-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanstobias%2Fcircular-queue/lists"}