{"id":37205779,"url":"https://github.com/bingxueshuang/deque","last_synced_at":"2026-01-14T23:42:18.379Z","repository":{"id":65430024,"uuid":"591588357","full_name":"bingxueshuang/deque","owner":"bingxueshuang","description":"Double ended queue","archived":false,"fork":false,"pushed_at":"2023-02-01T10:54:15.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-22T06:33:02.517Z","etag":null,"topics":["deque","golang","linked-list"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bingxueshuang.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}},"created_at":"2023-01-21T07:27:36.000Z","updated_at":"2023-02-01T10:10:04.000Z","dependencies_parsed_at":"2023-02-12T22:01:30.427Z","dependency_job_id":null,"html_url":"https://github.com/bingxueshuang/deque","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/bingxueshuang/deque","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingxueshuang%2Fdeque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingxueshuang%2Fdeque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingxueshuang%2Fdeque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingxueshuang%2Fdeque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bingxueshuang","download_url":"https://codeload.github.com/bingxueshuang/deque/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bingxueshuang%2Fdeque/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deque","golang","linked-list"],"created_at":"2026-01-14T23:42:17.850Z","updated_at":"2026-01-14T23:42:18.308Z","avatar_url":"https://github.com/bingxueshuang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deque\n\nThis package implements a double ended queue using circular doubly linked list.\nIt provides means for efficient insertion and retrieval at both the ends. It\ncan be used as a stack as well as a queue.\n\nBoth LIFO (last in first out) operations and FIFO (first in first out)\noperations are supported on the generic type `Deque`.\n\n## Performance\n\nDeque is a data structure that allows to add and remove items at both ends in\nconstant time. Thus, it is optimized for that purpose. Other operations like\naccess or modification to items present *somewhere* in the middle of the list\ntakes time linear the number of items in the deque.\n\nDoubly linked list allows items to be appended dynamically (unlike array or\nring buffer implementation). Since it is coded in go, all operations are\nmemory safe. `nil` deque is readonly. It means that methods like `Len`, `Clear`,\n`Front`, `Back`, `PopFront` and `PopBack` handle `nil` deques the same as empty\ndeque. But write or modify operations return `ErrInit`.\n\n## Examples\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"github.com/bingxueshuang/deque/v2\"\n)\n\nfunc main() {\n\tq := deque.New[string]()\n\tdeque.Must(q.PushBack(\"foo\"))  // { \"foo\" }\n\tdeque.Must(q.PushBack(\"bar\"))  // { \"foo\", \"bar\" }\n\tdeque.Must(q.PushFront(\"baz\")) // { \"baz\", \"foo\", \"bar\" }\n\n\tfmt.Println(\"Length:\", q.Len()) // 3\n\tfmt.Println(\"Front:\", deque.Must1(q.Front())) // baz\n\tfmt.Println(\"Back:\", deque.Must1(q.Back()))   // bar\n\n\tfmt.Println(\"Pop:\", deque.Must1(q.PopBack())) // bar\n\tfmt.Println(\"Pop:\", deque.Must1(q.PopBack())) // foo\n\tfmt.Println(\"Pop:\", deque.Must1(q.PopBack())) // baz\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbingxueshuang%2Fdeque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbingxueshuang%2Fdeque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbingxueshuang%2Fdeque/lists"}