All Projects → discord → Deque

discord / Deque

Licence: mit
Fast bounded deque using two rotating lists.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Deque

Fundamentals Of Python Data Structures
《数据结构(Python语言描述)》"Fundamentals of Python:Data Structures" 电子书和配套代码
Stars: ✭ 30 (-69.07%)
Mutual labels:  datastructures
Complete Placement Preparation
This repository consists of all the material required for cracking the coding rounds and technical interviews during placements.
Stars: ✭ 1,114 (+1048.45%)
Mutual labels:  datastructures
C
Collection of various algorithms in mathematics, machine learning, computer science, physics, etc implemented in C for educational purposes.
Stars: ✭ 11,897 (+12164.95%)
Mutual labels:  datastructures
Math Advanced Data Structures And Algorithms
Math, Advanced Data Structures & Algorithms - Please check before use
Stars: ✭ 40 (-58.76%)
Mutual labels:  datastructures
Awesome Java Leetcode
👑 LeetCode of algorithms with java solution(updating).
Stars: ✭ 8,297 (+8453.61%)
Mutual labels:  datastructures
Roaringbitmap
Roaring Bitmap in Cython
Stars: ✭ 64 (-34.02%)
Mutual labels:  datastructures
Phpalgorithms
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell
Stars: ✭ 865 (+791.75%)
Mutual labels:  datastructures
Datascience
It consists of examples, assignments discussed in data science course taken at algorithmica.
Stars: ✭ 92 (-5.15%)
Mutual labels:  datastructures
String Interner
A data structure to efficiently intern, cache and restore strings.
Stars: ✭ 60 (-38.14%)
Mutual labels:  datastructures
Adaptive Radix Tree
A fast and space efficient Radix tree in Java
Stars: ✭ 76 (-21.65%)
Mutual labels:  datastructures
Data Structure And Algorithms
A complete and efficient guide for Data Structure and Algorithms.
Stars: ✭ 48 (-50.52%)
Mutual labels:  datastructures
Cdcontainers
Library of data containers and data structures for C programming language.
Stars: ✭ 57 (-41.24%)
Mutual labels:  datastructures
Algorithms
University course material for Algorithms and Data Structures in Java, with a particular emphasis on software testing. Includes exercises, with solutions.
Stars: ✭ 66 (-31.96%)
Mutual labels:  datastructures
Algorithms
Here is the my solutions for problems in {leetcode, hackerrank, geeksforgeeks}
Stars: ✭ 36 (-62.89%)
Mutual labels:  datastructures
Data Structures And Algorithms
Python implementation of common algorithms and data structures interview questions
Stars: ✭ 84 (-13.4%)
Mutual labels:  datastructures
Data Structures
Walk-through and implementation of various data structures.
Stars: ✭ 15 (-84.54%)
Mutual labels:  datastructures
Datastructures
🚀 Implementation of core data structures for R
Stars: ✭ 64 (-34.02%)
Mutual labels:  datastructures
Repository
个人学习知识库涉及到数据仓库建模、实时计算、大数据、Java、算法等。
Stars: ✭ 92 (-5.15%)
Mutual labels:  datastructures
Cracking The Coding Interview
Tests, Questions and Solutions from Cracking the Coding Interview
Stars: ✭ 91 (-6.19%)
Mutual labels:  datastructures
Coding Cheat Sheets
Various cheat sheets on CS stuff
Stars: ✭ 1,172 (+1108.25%)
Mutual labels:  datastructures

Deque

Master Hex.pm Version

Erlang only supports fast prepends to lists while appending requires a full copy. Getting the size of a list is also a O(n) operation. This library implements a deque using two rotating lists to support fast append and prepend as well as O(1) size via an internal counter.

Features

  • Bounded size
  • Enumerable protocol
  • Collectable protocol
  • Inspect protocol

Usage

Add it to mix.exs

defp deps do
  [{:deque, "~> 1.0"}]
end

Then use it like other Elixir data structures.

# Deque<[3, 2, 1]>
deque =
  Deque.new(5)
  |> Deque.appendleft(1)
  |> Deque.appendleft(2)
  |> Deque.appendleft(3)

# Deque<[2, 1]>
{3, deque} = Deque.popleft(deque)

# Deque<[6, 7, 8, 9, 10]>
Enum.into(0..10, Deque.new(5))

License

Deque is released under the MIT License. Check LICENSE file for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].