C Programming Examples on Data-Structures

This section covers C Programming Examples on Datastructure. Every example program includes the description of the program, C code as well as output of the program. Here is the listing of C programming examples:

1. C Programming examples on “Hashing”

Hash table is a data structure used to implement an associative array, a structure that can map keys to values. Hash table uses a hash function to compute an index into an array of buckets or slots. Hash trie is a persistent data structure that can be used to implement sets and maps, intended to replace hash tables in purely functional programming. Rolling hash allows an algorithm to calculate the hash value without having the rehash in the given string. MinHash is a technique for quickly estimating how similar two sets are. Double hashing is a collision resolving technique in Hash tables. Linear Probing is used to probe the through the subsequent elements of array starting from hash code value where key collision occurs. The C programs in this section deals with the implementation of hash tables using singly linked lists, binary trees, list heads, doubly linked lists, double hashing, linear and quadratic probing. It also explains the implementation of hash tree, hash list, min hash, rolling and distributed hash table.

2. C Programming examples on “Heaps”

Heap is a specialized tree-based data structure that satisfies the heap property. Binary heap is one in which the every child node has value less than the value of the parent. Weak heap is a combination of the binary heap and binomial heap data structures for implementing priority queues. Binomial heap is a heap, which is pretty much similar to normal binary heap, with feature of quick merging of two heaps. Fibonacci heap is a collection of trees that satisfies the minimum heap property. Leftist heap is a priority queue implemented with a variant of a binary heap. The C programs in this section demonstrates the implementation of heaps, binary heap, fibonacci heap, skew heap, ternary heap, d-ary and weak heaps.

C Program to Implement Heap
C Program to Implement Binary Heap
C Program to Implement Weak Heap
C Program to Implement Binomial Tree
C Program to Implement Binomial Heap
C Program to Implement Fibonacci Heap
C Program to Implement LeftList Heap
C Program to Implement Skew Heap
C Program to Implement Ternary Heap
C Program to Implement D-ary-Heap

The following section contains programs which deal with Array, Vector, Stack, Queue and Linked Lists. Variable Length Array is an array data structure whose length is determined at run time. Vector elements are placed in contiguous storage so that they can be accessed and traversed using iterators. Adjacency list is efficient in terms of storage because we need to store the values for the edges. VList is a persistent data structure that combines the fast indexing of arrays with the easy extension of singly-linked lists. Stack is a LIFO data structure, Stack operations are PUSH, POP and Display stack. Queue works on First-In-First-Out Principle. The C programs in this section deals with implementation of variable length array, vector, bit array, adjacency list and matrix, vlist, linked list, skip list, stack, queue, pagoda and direct addressing tables.

C Program to Implement Variable Length Array
C Program to Implement Vector
C Program to Implement Bit Array
C Program to Implement Adjacency List
C Program to Implement Adjacency Matrix
C Program to Implement Graph Structured Stack
C Program to Implement Unrolled Linked List
C Program to Implement VList
C Program to Implement Xor Linked List
C Program to Implement Difference List
C Program to Implement Skip List
C Program to Implement Stack
C Program to Implement Queue
C Program to Implement Qequeue
C Program to Implement Pagoda
C Program to Implement Direct Addressing Tables
C Program to Implement Stack Using Two Queues
C Program to Implement Queue Using Two Stacks