DATA STRUCTURE - C Codes

B Tree

Description Program of insertion and deletion in B tree...In data structures, a B-tree is a tree data structure that keeps data sorted and allows searches, insertions, and deletions in logarithmic amortized time. Unlike self-balancing binary se ...

0 Comments. 2904 views since Jan 1, 2009

Breath First Search(BFS) and Depth First Search (DFS)

Description THIS CODE IS SIMPLE BUT NOT EASY TO WRITE SO PLEASE BEFORE RUNNING THE PROGRAM SEE THE CODE AND THEN RUN IF YOU DO'NT UNDERSTAND THEN SUMMIT QUERRY IN email address dwarikachandra@gmail.com Source Code <pre name="code" cl ...

0 Comments. 2730 views since Jan 6, 2009

Insertion in AVL Tree

Description Program for insertion in AVL tree...n Data Structure, an AVL tree is a self-balancing binary search tree, and it is the first such data structure to be invented. In an AVL tree, the heights of the two child subtrees of any node diff ...

0 Comments. 2512 views since Jan 1, 2009

Insertion Sort

Description The insertion sort works just like its name suggests - it inserts each item into its proper place in the final list. The simplest implementation of this requires two list structures - the source list and the list into which sorted i ...

0 Comments. 1759 views since Aug 20, 2008

All Operations on Link List

Description This code is about all operations performed on linked list. Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;alloc.h&gt; struct list { int data; struct list *next; }; ...

0 Comments. 1682 views since Aug 3, 2008

Shell sort

Description An example of Shell Sort algorithm. Source Code #include &lt;string.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void shell(char *items, int count) { int i, j, gap, k; ...

0 Comments. 1473 views since Sep 4, 2008

Bubble Sort in Data Structures

Description Bubble Sort in Data Structures using C Language. Source Code #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void bubble_sort(int array[], int size) { int temp, i, j; for ...

1 Comments. 1306 views since Dec 29, 2008

Heapsort

Description A program to implement Heap Sort. Source Code #include&lt;stdio.h&gt; void restoreHup(int*,int); void restoreHdown(int*,int,int); void main() { int a[20],n,i,j,k; p ...

0 Comments. 1303 views since Sep 4, 2008

Radix Sort

Description THIS IS THE SORTING MRTHOD TO SORT THE NUMBER Source Code #define NUMELTS 100 # include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;math.h&gt; void radixsort(int a[],int); voi ...

0 Comments. 1294 views since Jan 6, 2009

Bubble Sort

Description This is a code which implements Bubble Sort Algorithm. Source Code #include&lt;stdio.h&gt; #include&lt;stdlib.h&gt; #include&lt;conio.h&gt; int item[100]; int a, b, t; int count; ...

0 Comments. 1293 views since Sep 2, 2008

Merge Sort in Data Structure

Description Merge Sort in Data Structure using C Language. Source Code # include&lt;stdio.h&gt; # include&lt;stdlib.h&gt; #include&lt;conio.h&gt; #include&lt;malloc.h&gt; void merge_sort(int *, in ...

1 Comments. 1289 views since Dec 29, 2008

Tree Traversal

Description This is a program for demonstration of Tree Operations - INSERTION & INORDER, PREORDER, POSTORDER TRAVERSAL. Source Code # include&lt;stdio.h&gt; # include &lt;conio.h&gt; # include &lt;allo ...

0 Comments. 1262 views since Sep 3, 2008

Selection Sort

Description The selection sort works by selecting the smallest unsorted item remaining in the list, and then swapping it with the item in the next position to be filled. The selection sort has a complexity of O(n2).Pros: Simple and easy to impl ...

0 Comments. 1242 views since Aug 20, 2008

Knapsack problem

Description This is a program for implementing 0-1 knapsack problem Source Code #include &lt;stdio.h&gt; #define MAXWEIGHT 100 int n = 3; /* The number of objects */ int c[10] = {8, 6, 4 ...

0 Comments. 1232 views since Sep 18, 2008

Binary Tree

Description C Language: This is the code implementation of the Binary Tree Algorithm. Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;malloc.h&gt; #include&lt;process.h&gt; struct ...

0 Comments. 1219 views since Aug 23, 2008

Quick Sort in Data Structures

Description Quick Sort in Data Structures Using C Language. Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void quick_sort(int array[], int first, int last) { int temp, low, high, li ...

1 Comments. 1215 views since Dec 29, 2008

Shaker Sort

Description This program used to sort a String using Shaker Sort algorithm. Source Code #include &lt;string.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void shaker(char *items, int count ...

0 Comments. 1204 views since Sep 4, 2008

Heap Sort in Data Structures

Description Heapsort (method) is a comparison-based sorting algorithm, and is part of the selection sort family. Although somewhat slower in practice on most machines than a good implementation of quicksort, it has the advantage of a worst-case ...

0 Comments. 1198 views since Jan 1, 2009

Topological Sorting in Graphs

Description n graph theory, a topological sort or topological ordering of a directed acyclic graph (DAG) is a linear ordering of its nodes in which each node comes before all nodes to which it has outbound edges. Every DAG has one or more topol ...

0 Comments. 1186 views since Jan 1, 2009

Stack using Liknked List Implementation

Description it is stack using linkedlist implementation and defining push pop functions Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;process.h&gt; #define max 5 struct s ...

0 Comments. 1169 views since Dec 28, 2008

Quick Sort

Description C Language: A QuickSort Example Program Source Code #define MAXARRAY 10 void quicksort(int arr[], int low, int high); int main(void) { int array[MAXARRAY] = {0}; int i = 0; // load some r ...

0 Comments. 1158 views since Aug 23, 2008

Fractional Knapsack

Description This code solves the Fractional Knapsack problem. Source Code #include &lt;stdio.h&gt; int n = 5; /* The number of objects */ int c[10] = {12, 1, 2, 1, 4}; /* c[i] is the *COST* of ...

0 Comments. 1138 views since Sep 18, 2008

Tree Operations

Description This Program for demonstration of Tree Operations - INSERTION . INORDER . PREORDER . POSTORDER TRAVERSAL Source Code # include&lt;stdio.h&gt; # include &lt;conio.h&gt; # include &lt;malloc.h&g ...

0 Comments. 1117 views since Aug 23, 2008

Binary Search Tree

Description Insertion, Deletion and Traversal in Binary Search Tree...In Data Structures, a binary search tree (BST) is a binary tree data structure which has the following properties: * Each node (item in the tree) has a distinct valu ...

0 Comments. 1113 views since Jan 1, 2009

Stack Using Array

Description defining the push and pop functions of stack using array implementation Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;process.h&gt; #define max 5 struct stude ...

0 Comments. 1078 views since Dec 28, 2008

Queue Using Linked List

Description This code implements Queue with help of Linked List Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;stdlib.h&gt; struct node { int data; struct node *link; } ; ...

0 Comments. 1071 views since Apr 4, 2009

Count Sort

Description This is a Code which is used to impement CountSort Algorithm over a set of given numbers. Source Code #include &lt;iostream.h&gt; #include &lt;stdio.h&gt; #include &lt;conio.h&gt; void print( ...

0 Comments. 1051 views since Aug 17, 2008

Quick Sort

Description Sorting of array by quick sort method...... It is the most accurate method to sort the given array by user...... Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; int n,k[50 ...

0 Comments. 1041 views since Dec 27, 2008

Recursive Balanced Quick Sort

Description A variation of quick sort .it performs very well with time complexity of O(nlogn) always. it assures that in one pass 3 data will be sorted. Source Code #include&lt;stdio.h&gt; #include&lt;co ...

0 Comments. 1032 views since Jul 31, 2008

Circular Linked List

Description In a circularly-linked list, the first and final nodes are linked together. This can be done for both singly and doubly linked lists. To traverse a circular linked list, you begin at any node and follow the list in either direction ...

0 Comments. 1028 views since Jan 2, 2009

Double Linked List

Description Doubly-linked list - A more sophisticated kind of linked list is a doubly-linked list or two-way linked list. Each node has two links: one points to the previous node, or points to a null value or empty list if it is the first node; ...

0 Comments. 1025 views since Jan 1, 2009

Linear Search

Description C Language: Linear search program will search a no. whether present in array or not Source Code /*SEARCH*/ #include&lt;stdio.h&gt; main() { int m,i,j,t,n ...

0 Comments. 1023 views since Mar 1, 2009

Linked List: Binary Tree Implementation

Description Insertion & Deletion in a Binary Tree Source Code // Implementation Of BINARY TREE OPERATION (insertion &amp; Deletion) #include&lt;conio.h&gt; #include&lt;stdio.h&gt; #include&lt;malloc.h&gt ...

0 Comments. 983 views since Aug 20, 2008

Link List: Insertion

Description This code lets the user insert in a linked list Source Code #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;malloc.h&gt; struct node { int info; struct node *next; }; type ...

0 Comments. 919 views since Mar 18, 2009