All Projects → wolkykim → Qlibc

wolkykim / Qlibc

Licence: other
qLibc is a simple and yet powerful C library providing generic data structures and algorithms

Programming Languages

c
50402 projects - #5 most used programming language
cplusplus
227 projects

Projects that are alternatives of or similar to Qlibc

Sc
Common libraries and data structures for C.
Stars: ✭ 161 (-73.78%)
Mutual labels:  vector, stack, library, queue
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 (-79.64%)
Mutual labels:  vector, stack, tree-structure, queue
Libgenerics
libgenerics is a minimalistic and generic library for C basic data structures.
Stars: ✭ 42 (-93.16%)
Mutual labels:  vector, stack, library, queue
Fortress-of-Solitude
This Library has resources to solve common data structure algorithm problems like a Doubly linked list, Generic trees, Queue, Stack, and other algorithms. Each lib has an option to carry your custom data in elements. Custom data in detail, other fantastic resources.
Stars: ✭ 53 (-91.37%)
Mutual labels:  stack, queue, vector, tree-structure
Buckets Js
A complete, fully tested and documented data structure library written in pure JavaScript.
Stars: ✭ 1,128 (+83.71%)
Mutual labels:  stack, tree-structure, queue
Cdcontainers
Library of data containers and data structures for C programming language.
Stars: ✭ 57 (-90.72%)
Mutual labels:  stack, library, queue
Gostl
Data structure and algorithm library for go, designed to provide functions similar to C++ STL
Stars: ✭ 254 (-58.63%)
Mutual labels:  vector, stack, queue
C Macro Collections
Easy to use, header only, macro generated, generic and type-safe Data Structures in C
Stars: ✭ 192 (-68.73%)
Mutual labels:  stack, library, queue
Data-structures
Data Structures in Java
Stars: ✭ 13 (-97.88%)
Mutual labels:  stack, queue, tree-structure
Coding Interview Gym
leetcode.com , algoexpert.io solutions in python and swift
Stars: ✭ 451 (-26.55%)
Mutual labels:  stack, tree-structure, queue
InterviewBit
Collection of solution for problems on InterviewBit
Stars: ✭ 77 (-87.46%)
Mutual labels:  stack, queue
hatrack
Fast, multi-reader, multi-writer, lockless data structures for parallel programming
Stars: ✭ 55 (-91.04%)
Mutual labels:  stack, queue
Data-Structures
Algorithmic Problems Solutions -- hash table code featured in geeksforgeeks
Stars: ✭ 44 (-92.83%)
Mutual labels:  stack, queue
Algorithm-Data-Structures-Python
Various useful data structures in Python
Stars: ✭ 34 (-94.46%)
Mutual labels:  stack, queue
AlgoDaily
just for fun
Stars: ✭ 118 (-80.78%)
Mutual labels:  stack, queue
myleetcode
♨️ Detailed Java & Python solution of LeetCode.
Stars: ✭ 34 (-94.46%)
Mutual labels:  stack, queue
geeks-for-geeks-solutions
✅ My own Amazon, Microsoft and Google SDE Coding challenge Solutions (offered by GeeksForGeeks).
Stars: ✭ 246 (-59.93%)
Mutual labels:  stack, vector
DEPRECATED-data-structures
A collection of powerful data structures
Stars: ✭ 2,648 (+331.27%)
Mutual labels:  stack, queue
Data-Structures-and-Algorithms
Data Structures and Algorithms implementation in Python
Stars: ✭ 31 (-94.95%)
Mutual labels:  stack, queue
Javascript Datastructures Algorithms
📚 collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
Stars: ✭ 3,221 (+424.59%)
Mutual labels:  stack, queue

What's qLibc?

qLibc is currently one of the most functionally-complete, publicly-licensed C/C++ libraries. The goal of the qLibc project is to provide a simple and powerful general purpose C/C++ library that includes all kinds of containers and general library routines. It provides a ready-made set of common container APIs with a consistent API look.

qLibc Copyright

qLibc is published under 2-clause BSD license known as Simplified BSD License. Please refer the LICENSE document included in the package for more details.

API Reference

  • qlibc Core API Reference

    • Containers for Key/Value pairs
      • Tree Table --- in binary tree(left-leaning red-black tree) data structure.
      • Hash Table --- in hash-based data structure.
      • Static Hash Table --- in fixed size memory(array/mmapped/shared).
      • List Table --- in (doubly) linked-list data structure.
    • Containers for Objects
      • List --- Doubly Linked List.
      • Vector --- implements a growable array of elements.
      • Queue --- FIFO(First In First Out) implementation.
      • Stack --- LIFO(Last In First Out) implementation.
    • General utilities.
      • String --- string trimmer, modifier, replacer, case converter, pattern detectors, ...
      • I/O --- non-blocking I/O, stream reader/writer, ...
      • File --- file locking, file/directory hander, path correctors, ...
      • IPC, Semaphore Shared-memory
      • En/decoders --- Url en/decoder, Base64 en/decoder, Hex en/decoder, ...
      • Hashes --- Murmur hases, FNV hases, MD5 hashes, ...
      • Time --- time diff, time format converstion, ...
  • qLibc Extension API Reference

    • Apache-style Configuration File Parser.
    • INI-style Configuration File Parser.
    • HTTP client.
    • Rotating File Logger.
    • Database(MySQL) interface.
    • Token-Bucket

qLibc Tables at a Glance

Characteristics Tree Table Hash Table Static Hash Table List Table
Data structure Binary Tree Slot Index Block Array Linked-List
Search complexity O(log n) O(1) / O(n) O(1) / O(n) O(n)
Insert complexity O(log n) O(1) / O(n) O(1) / O(n) O(1)
Delete complexity O(log n) O(1) / O(n) O(1) / O(n) O(n)
Space complexity O(n) O(n) - O(n)
Space allocation Dynamic Dynamic Pre-allocation Dynamic
Key Stored Sorted Yes No No Yes (option)
User comparator Supported - - Supported
Duplicated keys No No No Yes (option)
Key stored digested No No Yes No
Search Nearest Key Yes No No No
Iterator support Yes Yes Yes Yes
Iterator visit order min -> max random random insert order
Thread-safe option Supported Suported User Supported
Can use shared mem No No Yes No

Consistent API Look

All container APIs have a consistent look and feel. It basically provides a creator function which usually returns a pointer to a container structure. Also, all functions related to the container can be accessed through function pointers inside of the container or traditional style direct access APIs. For an example,

So, regardless of which container you use, you can simply put elements into a list with container->put(container, ...) or you can call them using direct API like qtreetbl_pub(container, ...).

An examples below illustrates how it looks like.

  // create a hash-table.
  qhashtbl_t *tbl = qhashtbl(0, QHASHTBL_OPT_THREADSAFE);
  
  // add an element which key name is "score".
  int x = 12345;
  tbl->put(tbl, "score", &x, sizeof(int));
  
  // get the value of the element.
  int *px = tbl->get(tbl, "score");
  if(px != NULL) {
    printf("%d\n", *px);
    free(px);
  }
  
  // release table
  tbl->free(tbl);

Here is an identical implementation with a Linked-List-Table container. You may notice that there aren't any code changes at all, except for 1 line in the table creation. This is why qLibc encapsulates corresponding function pointers inside of the container object.

  // create a linked-list-table. THE ONLY LINE YOU NEED TO CHANGE.
  qlisttbl_t *tbl = qlisttbl(QLISTTBL_OPT_THREADSAFE);
  
  // add an element which key name is "score".
  int x = 12345;
  tbl->put(tbl, "score", &x, sizeof(int));
  
  // get the value of the element.
  int *px = tbl->get(tbl, "score");
  if(px != NULL) {
    printf("%d\n", *px);             
    free(px);
  }
  
  // release table
  tbl->free(tbl);

Looking for people to work with.

We're looking for people who want to work together to develop and improve qLibc. Currently, we have high demands on following areas.

  • Automated testing
  • Documentation.
  • New feature implementation.

Contributors

The following people have helped with suggestions, ideas, code or fixing bugs: (in alphabetical order by first name)

If we have forgotten or misspelled your name, please let us know.

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