{"id":13606926,"url":"https://github.com/skyzh/data-structure-deque","last_synced_at":"2025-10-27T03:31:32.972Z","repository":{"id":85472370,"uuid":"241032043","full_name":"skyzh/data-structure-deque","owner":"skyzh","description":"A deque of O(sqrt n) complexity on access, insert and remove, with an optimization for O(log n) access based on fenwick tree.","archived":false,"fork":false,"pushed_at":"2020-02-17T06:25:54.000Z","size":28,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T01:51:17.740Z","etag":null,"topics":["binary-indexed-tree","cpp","deque","fenwick-tree"],"latest_commit_sha":null,"homepage":"https://gist.github.com/skyzh/2597b532ad191036ae4a6dc785859e5b","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/skyzh.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}},"created_at":"2020-02-17T06:05:24.000Z","updated_at":"2023-06-29T22:26:48.000Z","dependencies_parsed_at":"2023-03-11T20:46:16.242Z","dependency_job_id":null,"html_url":"https://github.com/skyzh/data-structure-deque","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/skyzh%2Fdata-structure-deque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Fdata-structure-deque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Fdata-structure-deque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzh%2Fdata-structure-deque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyzh","download_url":"https://codeload.github.com/skyzh/data-structure-deque/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238431590,"owners_count":19471419,"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":["binary-indexed-tree","cpp","deque","fenwick-tree"],"created_at":"2024-08-01T19:01:13.854Z","updated_at":"2025-10-27T03:31:27.681Z","avatar_url":"https://github.com/skyzh.png","language":"C++","readme":"# data-structure-deque\n\nA deque of O(sqrt(n)) complexity on access, insert and remove, with an optimization for O(logn) access based on fenwick tree.\n\nYou may found the optimized version [here](https://github.com/skyzh/data-structure-deque/blob/master/deque_fenwick_tree_vector.hpp).\nThis one is four times faster than [Sqrt Vector](https://github.com/skyzh/data-structure-deque/blob/master/deque_sqrt_vector.cpp)\nversion on large data.\n\nThis repo is migrated from my [GitHub gist](https://gist.github.com/skyzh/2597b532ad191036ae4a6dc785859e5b).\n\n## Failed Attempts and Other Implementations\n\n* [Linked List](https://github.com/skyzh/data-structure-deque/blob/master/deque_linkedlist.cpp): O(n) access, O(1) insert \u0026 remove\n* [Ring Buffer](https://github.com/skyzh/data-structure-deque/blob/master/deque_ring_buffer.cpp): O(1) access, O(n) insert \u0026 remove (Like the one bundled with GNU C++ STL)\n* [Sqrt Vector](https://github.com/skyzh/data-structure-deque/blob/master/deque_sqrt_vector.cpp): O(sqrt(n)) access, O(sqrt(n)) insert \u0026 remove\n* [Chunk Vector](https://github.com/skyzh/data-structure-deque/blob/master/deque_vector_chunk.cpp): O(n/chunk_size) access, O(n) insert \u0026 move\n\n## Related Works\n\nAnother data-structure project I've done is a [B+ Tree](https://github.com/skyzh/BPlusTree) built from scratch.\nThis B+ tree supports on-disk persistence, on-demand paging and LRU. I've written several unit tests for it.\n","funding_links":[],"categories":["资源清单"],"sub_categories":["CS0501 + CS0501H (原 CS149 + CS158 + CS358) - 数据结构 + 数据结构 (荣誉) + 数据结构A"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyzh%2Fdata-structure-deque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyzh%2Fdata-structure-deque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyzh%2Fdata-structure-deque/lists"}