All Projects → jarun → dslib

jarun / dslib

Licence: GPL-3.0 license
🌿 A library of "connected" data structures

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
CMake
9771 projects

Projects that are alternatives of or similar to dslib

Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+2.46%)
Mutual labels:  tree, stack
Leetcode
High-quality LeetCode solutions
Stars: ✭ 178 (+45.9%)
Mutual labels:  tree, stack
Java Ds Algorithms
Data Structures and Algorithms in Java
Stars: ✭ 125 (+2.46%)
Mutual labels:  tree, stack
Data Structures
This repository contains some data structures implementation in C programming language. I wrote the tutorial posts about these data structures on my personal blog site in Bengali language. If you know Bengali then visit my site
Stars: ✭ 82 (-32.79%)
Mutual labels:  tree, stack
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (-72.95%)
Mutual labels:  tree, avl
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 (+8820.49%)
Mutual labels:  tree, stack
Algo Tree
Algo-Tree is a collection of Algorithms and data structures which are fundamentals to efficient code and good software design. Creating and designing excellent algorithms is required for being an exemplary programmer. It contains solutions in various languages such as C++, Python and Java.
Stars: ✭ 166 (+36.07%)
Mutual labels:  tree, stack
Learningmasteringalgorithms C
Mastering Algorithms with C 《算法精解:C语言描述》源码及Xcode工程、Linux工程
Stars: ✭ 615 (+404.1%)
Mutual labels:  tree, stack
Data-Structure-Algorithm-Programs
This Repo consists of Data structures and Algorithms
Stars: ✭ 464 (+280.33%)
Mutual labels:  tree, stack
data-structure-project
自己实现集合框架系列整理总结
Stars: ✭ 29 (-76.23%)
Mutual labels:  tree, stack
Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+824.59%)
Mutual labels:  tree, stack
BasicExercises
📘 Personal basic practice test playground.
Stars: ✭ 84 (-31.15%)
Mutual labels:  tree, stack
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-56.56%)
Mutual labels:  tree, stack
Data Structures With Go
Data Structures with Go Language
Stars: ✭ 121 (-0.82%)
Mutual labels:  tree, stack
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (-71.31%)
Mutual labels:  tree, stack
Data Structures
Common data structures and algorithms implemented in JavaScript
Stars: ✭ 139 (+13.93%)
Mutual labels:  tree, stack
Datastructure
常用数据结构及其算法的Java实现,包括但不仅限于链表、栈,队列,树,堆,图等经典数据结构及其他经典基础算法(如排序等)...
Stars: ✭ 419 (+243.44%)
Mutual labels:  tree, stack
Algodeck
An Open-Source Collection of 200+ Algorithmic Flash Cards to Help you Preparing your Algorithm & Data Structure Interview 💯
Stars: ✭ 4,441 (+3540.16%)
Mutual labels:  tree, stack
Interview Questions
List of all the Interview questions practiced from online resources and books
Stars: ✭ 187 (+53.28%)
Mutual labels:  tree, stack
ctl
My variant of the C Template Library
Stars: ✭ 105 (-13.93%)
Mutual labels:  tree, stack

dslib

dslib is a library of cohesive data structures. The goal of dslib is to demonstrate how complex data structures (and related algorithms) can be developed by reusing simpler ones. In general, textbooks come with numerous unrelated examples, each relevant to a specific data structure. dslib, on the other hand, grows by building on the elementary data structures.

The core component is a circular doubly linked list. Library-internal data structures are dynamically (de)allocated.

Most of the code conforms to the Linux kernel coding standards (verified against checkpatch.pl), other than a few unavoidable instances.

dslib is an academic library. However, we'll be glad if someone finds any other application of it.

Donate via PayPal!

Table of Contents

Building blocks

DS Description
dlist Circular doubly linked list. Node has next, prev and data (void *, caller (de)allocates) pointers.
queue Builds on top of dlist. Each element is a dlist node pointing to the value inserted in the queue.
stack Builds on top of dlist. Each element is a dlist node pointing to the value pushed in the stack.
tree A binary search tree, stores integers.
AVL An AVL tree implementation, stores integers.
BFS Iterative Breadth-first search for tree and AVL implemented using the queue.
DFS Iterative Depth-first search for tree implemented using the stack.

There are test cases for each DS. Though not very organized, they provide an insight into the usage of dslib.

APIs

A complete list of APIs can be found in apilist.txt. Most of the APIs are iterative. The following 2 APIs are recursive and the iterative implementations are left as an exercise:

bool delete_tree_node(tree_pp head, int val);
bool delete_avl_node(avl_pp head, int val);

Thread-safety

Currently the Thread-Safe mode is implemented only for AVL. The lock functions are in common.h and common.c and it's easy to extend thread-safety in other structures.

Compilation

The following compilation steps are tested on Ubuntu 14.04.4 x86_64:

$ git clone https://github.com/jarun/dslib/
$ cd dslib
$ make

To install dslib, run:

$ sudo make install

To remove dslib from your system, run:

$ sudo make uninstall

Clean up (cleans test executables too):

$ make clean

Testing

Make sure dslib is installed. To compile test cases under test subdirectory:

$ sudo make install
$ make test

Only informative logs are enabled. For DEBUG logs, set:

int current_log_level = DEBUG;

in the source test file.

Developers

Contributions

Contributions are welcome! We would love to see more data structures and APIs added to dslib.

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