All Projects â†’ recp â†’ ds

recp / ds

Licence: MIT license
🔗 Common Data Structures and Algorithms

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects
M4
1887 projects

Projects that are alternatives of or similar to ds

Gods
GoDS (Go Data Structures). Containers (Sets, Lists, Stacks, Maps, Trees), Sets (HashSet, TreeSet, LinkedHashSet), Lists (ArrayList, SinglyLinkedList, DoublyLinkedList), Stacks (LinkedListStack, ArrayStack), Maps (HashMap, TreeMap, HashBidiMap, TreeBidiMap, LinkedHashMap), Trees (RedBlackTree, AVLTree, BTree, BinaryHeap), Comparators, Iterators, …
Stars: ✭ 10,883 (+27107.5%)
Mutual labels:  tree, data-structure, red-black-tree
AlgoDaily
just for fun
Stars: ✭ 118 (+195%)
Mutual labels:  tree, binary-search-tree, algorithms-datastructures
lua-algorithms
Lua algorithms library that covers commonly used data structures and algorithms
Stars: ✭ 57 (+42.5%)
Mutual labels:  binary-search-tree, red-black-tree, balanced-search-trees
Algorithms
Java implementation for Introduction to Algorithms book.
Stars: ✭ 58 (+45%)
Mutual labels:  tree, data-structure, red-black-tree
Leetcode
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)
Stars: ✭ 45,650 (+114025%)
Mutual labels:  tree, algorithms-datastructures
Algorithms
Minimal examples of data structures and algorithms in Python
Stars: ✭ 20,123 (+50207.5%)
Mutual labels:  tree, data-structure
gb merkle trees
General balanced binary Merkle trees for Erlang
Stars: ✭ 25 (-37.5%)
Mutual labels:  tree, binary-search-tree
BokkyPooBahsRedBlackTreeLibrary
BokkyPooBah's Red-Black Binary Search Tree Library
Stars: ✭ 117 (+192.5%)
Mutual labels:  binary-search-tree, red-black-tree
Merkle
Node.js module implementing Merkle tree algorithm
Stars: ✭ 123 (+207.5%)
Mutual labels:  tree, hash
js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+40%)
Mutual labels:  data-structure, search-trees
ipld-explorer-cli
🔎 Explore the IPLD directed acyclic graph with your keyboard
Stars: ✭ 22 (-45%)
Mutual labels:  tree, hash
Data-Structures-and-Algorithms
Implementation of various Data Structures and algorithms - Linked List, Stacks, Queues, Binary Search Tree, AVL tree,Red Black Trees, Trie, Graph Algorithms, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Segment Trees etc.
Stars: ✭ 144 (+260%)
Mutual labels:  tree, binary-search-tree
fortran-octree
A Fortran octree implementation
Stars: ✭ 17 (-57.5%)
Mutual labels:  data-structure, octree
js-symbol-tree
Turn any collection of objects into its own efficient tree or linked list using Symbol
Stars: ✭ 86 (+115%)
Mutual labels:  tree, data-structure
Bplustree
A minimal but extreme fast B+ tree indexing structure demo for billions of key-value storage
Stars: ✭ 1,598 (+3895%)
Mutual labels:  tree, data-structure
RedBlackTree-An-Intuitive-Approach
Demystifying Red Black Trees
Stars: ✭ 26 (-35%)
Mutual labels:  tree, red-black-tree
Leetcode
High-quality LeetCode solutions
Stars: ✭ 178 (+345%)
Mutual labels:  tree, data-structure
Binarytree
Python Library for Studying Binary Trees
Stars: ✭ 1,694 (+4135%)
Mutual labels:  data-structure, binary-search-tree
Algorithm-Data-Structures-Python
Various useful data structures in Python
Stars: ✭ 34 (-15%)
Mutual labels:  tree, hash-table
ctl
My variant of the C Template Library
Stars: ✭ 105 (+162.5%)
Mutual labels:  tree, rbtree

🔗 Data Structures and Algorithms

Build Status Build status Coverage Status Codacy Badge

This library provides common data structures. It will also provide some data structures which needed in render or game engines. In the future I'll try to optimize memmory access.

There may multiple way to implement a data structure but I tried to implement best way to do that. For instance Red-Black Trees are only implemented as top down insertion/deletion to make it faster.

There are some convenient constructors for common use cases. For instance rb_newtree_str() creates new rb-tree that uses strings as key, rb_newtree_ptr() creates new rb-tree that uses pointers as key. When you use these functions to alloc a data structure then you don't need to provide compare or print functions.

This library prodives allocator api so you can override default allocator.

Usage

#include <ds/rb.h> // Red-Black Tree

int
main(int argc, const char * argv[]) {
  RBTree *tree;
  /* ... */

  /* use string keys */
  tree = rb_newtree_str();

  rb_insert(tree, "key", value);

  /* ... */
  value = rb_find(tree, "key");

  rb_destroy(tree);
}

Todo

  • rbtree
    • top-down insertion
    • top-down deletion
  • forward-list
    • forward-list-separate (reduces FList struct)
  • hash-table
    • builtin hash functions e.g. djb2
    • resizing hash table
  • quick sort implementation for float, double, i32, u32, i64, u64
  • queue (working on this)
  • stack
  • binary heap / priority queue
  • dynamic array
  • octree
  • quadtree
  • kd-tree
  • bvh
  • b-tree

Build

Unix (Autotools)

$ sh autogen.sh
$ ./configure
$ make
$ make check # [Optional]
$ [sudo] make install # [Optional]

Windows (MSBuild)

Windows related build, project files are located in win folder, make sure that you are inside in the libds/win folder. Code Analysis are enabled, it may take awhile to finish build

$ cd win
$ .\build.bat

if msbuild didn't work then you can try to build it with devenv:

$ devenv libds.sln /Build Release

License

MIT. check the LICENSE file

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].