C program to implement linked list

Thursday, June 7th, 2012  »  Posted By  »  Total 0 Comment

Below given C program implements linked list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 […]

C++ program to implement B-Trees

Wednesday, February 2nd, 2011  »  Posted By  »  Total 17 Comments

#include <iostream.h> #include <stdlib.h> #include <alloc.h> const int MAX = 4 ; const int MIN = 2 ; struct btnode { int count ; int value[MAX + 1] ; btnode *child[MAX + 1] ; } ; class btree { private : btnode *root ; public : btree( ) ; void insert ( int val ) […]

C++ program to implement AVL Tree & its Operations

Wednesday, February 2nd, 2011  »  Posted By  »  Total 7 Comments

#include <iostream.h> #include <stdlib.h> #include<constream.h> #define FALSE 0 #define TRUE 1 struct AVLNode { int data ; int balfact ; AVLNode *left ; AVLNode *right ; } ;   class avltree { private : AVLNode *root ; public : avltree( ) ; AVLNode* insert ( int data, int *h ) ; static AVLNode* buildtree ( […]

C++ program to implement Binary Search Tree(BST) and its Operations

Wednesday, February 2nd, 2011  »  Posted By  »  Total 1 Comment

#include <iostream.h> class btree { private : struct node { node *left ; char data ; node *right ; } *root ; char *arr ; int *lc ; int *rc ; public : btree ( char *a, int *l, int *r, int size ) ; void insert ( int index ) ; static node* buildtree […]

C++ program for creation and traversal of a Binary Tree

Wednesday, February 2nd, 2011  »  Posted By  »  Total 13 Comments

#include<iostream.h> #include<conio.h> #include<process.h> struct tree_node { tree_node *left; tree_node *right; int data; } ; class bst { tree_node *root; public: bst() { root=NULL; } int isempty() { return(root==NULL); } void insert(int item); void inordertrav(); void inorder(tree_node *); void postordertrav(); void postorder(tree_node *); void preordertrav(); void preorder(tree_node *); }; void bst::insert(int item) { tree_node *p=new tree_node; […]

C++ program to implement Queue using Linked Representation

Monday, January 31st, 2011  »  Posted By  »  Total 3 Comments

#include <iostream.h> template<class T> class Node { friend LinkedQueue<T>; private: T data; Node<T> *link; }; template<class T> class LinkedQueue { public: LinkedQueue() {front = rear = 0;} // constructor ~LinkedQueue(); // destructor int IsEmpty() const {return ((front) ? 0 : 1);} T First() const; // return first element T Last() const; // return last element […]

C++ program to implement Queue using Formula Based Representation

Monday, January 31st, 2011  »  Posted By  »  Total 0 Comment

#include <iostream.h> #include <conio.h> class queue { private :   int *arr ; int front, rear ; int MAX ; public : queue( int maxsize = 10 ) ; void addq ( int item ) ; int delq( ) ; } ; queue :: queue( int maxsize ) { MAX = maxsize ; arr = […]

C++ program to implement Hash Table

Monday, January 31st, 2011  »  Posted By  »  Total 1 Comment

#include <iostream.h> #include <stdlib.h> #include<constream.h> template<class E, class K> class HashTable { public: HashTable(int divisor = 11); ~HashTable() {delete [] ht; delete [] empty;} int Search(const K& k, E& e) const; HashTable<E,K>& Insert(const E& e); void Output();// output the hash table void del(E e); private: int hSearch(const K& k) const; int D; // hash function […]

Program to represent Indirect Addressing of Linear List using Templates

Saturday, January 29th, 2011  »  Posted By  »  Total 0 Comment

IndirectList(int MaxLinearSize=10);
~IndirectList();//destructor
int IsEmpty()const{return length==0;}
int Length()const{return length;}
int Find(int k,T&x)const;
int Search(const T&x)const;
void Delete(int k,T&x);
void Insert(int k,const T&x);
void Output()const;

Program to implement linked representation of Linear list using templates

Friday, January 28th, 2011  »  Posted By  »  Total 0 Comment

#include<iostream.h> #include<constream.h> #include<stdlib.h> template<class T> class ChainNode { friend Chain<T>; private: T data; ChainNode<T>*link; }; template<class T> class Chain { private: ChainNode<T>*first; public: Chain() { first=0; } ~Chain(); int IsEmpty()const; int Length()const; int Find(int k,T&x); int Search(const T&x); void Delete(int k,T&x); void Insert(int k,const T&x); void Output(); }; template<class T> Chain<T>::~Chain() { ChainNode<T>*next; while(first) { […]

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup

Email: