vndmtrx / libadt

:vertical_traffic_light:libadt - an abstract data types library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libadt - an abstract data types library

BinaryTree

Status

MIT licensed Build Status codecov Codacy Badge

What is libadt?

Libadt is a C library for those who want to study a little more about Abstract Data Types. The library implements the most common types of structures of computer science and is extremely well documented.

ADTs are a theoretical concept in computer science, used in the design and analysis of algorithms, data structures, and software systems, and do not correspond to specific features of computer languages - mainstream computer languages do not directly support formally specified ADTs. However, various language features correspond to certain aspects of ADTs, and are easily confused with ADTs proper; these include abstract types, opaque data types, protocols, and design by contract. -- Wikipedia

Why?

Because in C we deal directly with memory, and the structures provided by the language are quite primitive. And since in higher level languages there are other structures (such as classes and objects) that implement many of the features of data structures, there would be no advantage (or learning) in implementing these structures on such languages.

What Structures do you have now?

  • Singly-linked list (README);
  • Doubly-linked list (README);
  • Deque using doubly-linked list as infrastructure (README);
  • Queues
    • using singly-linked list as infrastructure (README);
    • using deque as infrastructure (README);
  • Stacks
    • using singly-linked list as infrastructure (README);
    • using deque as infrastructure (README);

But this repository is in its very beginning and another structures will come in time.

What structures do you plan to implement?

At the present time, the following structures are being implemented:

  • Circular Linked List (README);

Once completed, the next to be implemented are as follows:

  • Trees (Binary Search Tree, AVL Tree, Red-black Tree);
  • Heaps;
  • Priority Structures (P-Queue, P-Stack and P-Deque);
  • Sets using sorted tree as infrastructure;
  • Stack and Queue using tree as infrastructure;
  • Priority Structures (P-Queue, P-Stack and P-Deque) using sorted tree as infrastructure;
  • Associative Arrays;
  • Sparse Matrixes;
  • Graphs;

Other related algorithms

When we are dealing with data structures, certain code patterns appear in the form of specialized algorithms to work with each type of structure.

With that in mind, we will be adding these algorithms into another folder to avoid confusion between data structures and algorithms that operate on top of these.

Algorithms implemented:

  • Infix to Postfix converter using Stack;
  • Expression evaluator using Queue;
  • Iterators for Lists;

Algorithms being implemented:

  • Sorting
    • Quick Sort
    • Merge Sort

Naming structure

In some data structures, you may notice that there is a prefix the name of each function. The prefixes refer to the structures used to build each structure. For example, stacks and queues use the prefix "sl_" because they use a simple linked list internally, in its implementation. This notation is used because, in the future, there can be other implementations using different support structures such as heaps or trees.

Base Documentation

Dictionary of Algorithms

Future and beyond...

There is no future set. Getting to the point we implement all the most common and important structures, other focuses will be defined, always having its focus on the learning provided to the person who will use these structures.

Have fun!

About

:vertical_traffic_light:libadt - an abstract data types library

License:MIT License


Languages

Language:C 86.1%Language:CMake 13.9%