Electrofriends

C++ program to implement circular queue ADT using an array

by Ranjith | March 11th, 2010.

/* Write a C++ program to implement circular queue ADT using an array */ #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; class cqueue { int q[5],front,rare; public: cqueue() { front=-1; rare=-1; } void push(int x) { if(front ==-1 && rare == -1) { q[++rare]=x; front=rare; return; } else if(front == (rare+1)%5 ) { cout <<" Circular [...]

Read More..

C++ program to implement the Queue ADT using a single linked list

by Ranjith | March 11th, 2010.

/* Write C++ programs to implement the Queue ADT using a singly linked list */ #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std; class node { public: class node *next; int data; };   class queue : public node { node *head; int front,rare; public: queue() { front=-1; rare=-1; } void push(int x) { if (rare < [...]

Read More..

C++ programs to implement the Stack ADT using a singly linked list

by Ranjith | March 10th, 2010.

while(temp->next != NULL)
temp=temp->next;
temp1=new node;
temp->next=temp1;
temp1->next=NULL;
temp1->data=x;

Read More..

C++ programs to implement the Queue ADT using an array

by Ranjith | March 10th, 2010.

/* Write C++ programs to implement the Queue ADT using an array */ #include<iostream> #include<conio.h> #include<stdlib.h> using namespace std;   class queue { int queue1[5]; int rear,front; public: queue() { rear=-1; front=-1; } void insert(int x) { if(rear > 4) { cout <<"queue over flow"; front=rear=-1; return; } queue1[++rear]=x; cout <<"inserted" <<x; } void delet() [...]

Read More..

C++ programs to implement the Stack ADT using an array

by Ranjith | March 10th, 2010.

void push(int x)
{
if(top > 4)
{
cout <<“stack over flow”;
return;
}
stk[++top]=x;
cout <<“inserted” < }

Read More..

C++ program to implement all the functions of a dictionary (ADT) using hashing

by Ranjith | March 10th, 2010.

class Dictionary
{
public:
int index;

Dictionary();
void insert(int);
void search(int);
void delete_ele(int);
};

Read More..

C++ program to implement the double ended queue using a double linked list

by Ranjith | March 10th, 2010.

class node
{
public:
int data;
class node *next;
class node *prev;
};

Read More..

C++ program to perform Insert, Delete, Search an element into a binary search tree

by Ranjith | March 10th, 2010.

/* Write a C++ program to perform the following operations:
a) Insert an element into a binary search tree.
b) Delete an element from a binary search tree.
c) Search for a key element in a binary search tree. */

Read More..

C++ program to perform Insertion and Deletion operations on AVL-trees

by Ranjith | March 10th, 2010.

void AVL::display(AVLNODE *temp)
{
if(temp==NULL)
return;
cout<data<<" ";
display(temp->left);
display(temp->right);
}

Read More..

Share and enjoy

    • Digg
    • Facebook
    • Technorati
    • StumbleUpon
    • Twitter
    • Reddit
    • del.icio.us
    • Yahoo! Buzz
Copyright©2009 www.electrofriends.com All Rights Reserved. Powered by Dhyeya