This repo contains the following C libraries:
- Binary Search Trees: both iterative and recoursive
- Heap trees
- Graphs
The library manage BST of generic type and has the following funcitionality (both iterative and recoursive):
- insertion of a node in a BST;
- printing of all the elements present in a BST;
- deletion of all elements of in a BST;
- deletion from a BST given an input item;
- deletion from a given ABR of all items containing an item that meets the following property: "has a v key such that a ≤ v ≤ b, with a and b input elements, and is at depth p with p1 ≤ p ≤ p2, where p1 and p2 are input integers';
- duplication of an input BST as the only parameter of the function;
- verifies if two BST data are identical, i.e. if they have the same keys and the same shape;
- filling an ordered array containing all the elements of a given BST;
- construction of a perfectly balanced BST from a given BST.
N.B.: the two libraries exhibit the same level of efficiency.
The library provides the representation of weighted and unweighted graphs, by tree and array.
- display / extract the minimum value
- display / extract the maximum value
- decreases a key
- increase a key
- insert key
- clear key
- delete whole heap
The library provides the representation of weighted and unweighted graphs, by adjacency matrices and adjacency lists.
- Inserting/deleting a new vertex;
- Inserting/deleting a new arc;
- Visit in width of a graph;
- Visit in depth of a graph;
- Calculation and printing of routes between two vertices (any route, minimum length route, minimum weight route);
- Calculation of the maximum subgraph that can be reached from a given vertex;
- Calculation of the transposed graph;
- Verification of acyclicity of a graph;
- Calculation and printing of a topological order of the vertices of the graph;
- Conversion of three graph representations (e.g.: adjacency lists ↔ adjacency matrix);
All the libraries, were developed on Linux (latest gcc version)
Valgrind is a powerfull tool! It was mainly used to find memory leaks. Read more here