Skip to content

skyzh/data-structure-deque

Repository files navigation

data-structure-deque

A deque of O(sqrt(n)) complexity on access, insert and remove, with an optimization for O(logn) access based on fenwick tree.

You may found the optimized version here. This one is four times faster than Sqrt Vector version on large data.

This repo is migrated from my GitHub gist.

Failed Attempts and Other Implementations

  • Linked List: O(n) access, O(1) insert & remove
  • Ring Buffer: O(1) access, O(n) insert & remove (Like the one bundled with GNU C++ STL)
  • Sqrt Vector: O(sqrt(n)) access, O(sqrt(n)) insert & remove
  • Chunk Vector: O(n/chunk_size) access, O(n) insert & move

Related Works

Another data-structure project I've done is a B+ Tree built from scratch. This B+ tree supports on-disk persistence, on-demand paging and LRU. I've written several unit tests for it.

About

A deque of O(sqrt n) complexity on access, insert and remove, with an optimization for O(log n) access based on fenwick tree.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy