Share your repls and programming experiences

← Back to all posts
C Everything - A 'C' based generic data structure and algorithms library
jar3m

I've been working on creating a C++ STL style generic data structures and algorithm library using C. Although it is a work in progress, I think it is in a good state for you people to check it out and share your ideas and share your feedback.

INFO

  • This is a C repository containing a curated set of data structures and algorithm.website
  • The data structures are implemented keeping them Generic and Abstract.
  • Genericness: Since in C any data structure is completely type dependent, we've tried to achieve a genric data structure that supports any standard data types (int, char, float, etc..) and user defined data types (struct user {})
    • The means by which we achieved a data structure by storing the pointer to the data (standard or user defined) rather the data itself
    • Given below is a snippet of code explaining the same,
  • Abstractness: The operations/procedures for each data structure is abstracted to the user by using function pointers, thus creating a psuedo class like structure

LIST OF DATA STRUCTURES

ALGORITHMS

  • Searching

    • Linear Search
    • Binary Search
  • Sorting

    • Insertion Sort
    • Selection Sort
    • Bubble Sort
    • Quick Sort
    • Merge Sort
    • Heap Sort
  • Graph Algorithms

    • Dijkstra's Shortest Path
    • Bellman Ford Shortest Path
    • Prim's Minimum Spanning Tree
    • Kruskal's Minimum Spanning Tree

Code Documentation

CONFIGURE

Create a folder called bin inder the following directories ds/, common/ and test/

Def.make change flags

BUILD

$ make clean; make all

TEST

Test case are as defined in test/src/test.c

RUN

$ ./foo.out

Voters
jar3m