Skip to content

Latest commit

 

History

118 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CERPEC

Cerpec is a personal project that aims to recreate popular data structures for the C programming language. These are divided based on their length into finite and 'infinite' (adjustable) structures.

Prerequisite

C compiler that supports at least the C99 standard, for example:

CMake for proper build process.

Download

  • Either save it as a ZIP, then unzip it in your project
  • or clone it locally:
# example: 
git clone --recursive https://github.com/TheGAzed/cerpec.git

Initialize

CMake code snipped showing how to add and link cerpec as a library:

set(CERPEC_TEST OFF)
add_subdirectory([path-to-folder]/cerpec)
# ...
target_link_libraries([target-name] PRIVATE cerpec)

List of Implemented Data Structures:

  • STACK
  • QUEUE
  • DEQUE
  • STRAIGHT LIST
  • CIRCULAR LIST
  • DOUBLE LIST
  • HASH SET
  • BITWISE SET
  • RED-BLACK SET
  • BINARY SEARCH TREE
  • AVL TREE
  • RED-BLACK TREE
  • BINARY HEAP
  • SEPARATE CHAINING HASH MAP

DODAC

The cerpec library comes with a separately provided dodac library implementing some function pointer used in the data structures. These data types are: char, unsigned char, int, unsigned int, float, double, size_t, and string character pointers (char*).

Caution

String compare functions stringcmp and stringrcmp use strcmp under the hood - making null termination mandatory.

Caution

Floating point (float and double) data type comparisons may not be precise and epsilon-comparison isn't supported yet.