# 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. 2971 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. 2789 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. 2546 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. 1884 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. 1726 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. 1527 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. 1356 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. 1344 views since Sep 4, 2008

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. 1342 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. 1336 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. 1333 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. 1304 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. 1292 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. 1283 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. 1273 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. 1259 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. 1253 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. 1241 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. 1226 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. 1216 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. 1211 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. 1193 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. 1165 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. 1164 views since Jan 1, 2009

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. 1126 views since Apr 4, 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. 1125 views since Dec 28, 2008

## 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. 1096 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. 1089 views since Dec 27, 2008

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. 1078 views since Jan 2, 2009

## 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. 1075 views since Jul 31, 2008

## 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. 1068 views since Mar 1, 2009

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. 1065 views since Jan 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. 1021 views since Aug 20, 2008