Archive for April 2014
#include< iostream >
#include< cstdlib >
#include< string >
using namespace std;
struct tree
{
int info;
tree *Left, *Right;
};
tree *root;
class...
Sorted Doubly Linked List with Insertion and Deletion
Posted by Naveen's Blogs
Tag :
Data Structures,
Linked list
#include < iostream >
#include < cstdlib >
#include < string >
using namespace std;
class Dllist
{
private:
typedef struct Node
{
string...
#include< iostream.h >
#include< conio.h >
#include< stdlib.h >
class list
{
struct node
{
int data;
node *link;
}*p;
public:
...
#include< iostream.h >
#include< constream.h >
void read(int a[10],int n)
{
cout << "reading\n";
for(int i=0;i < n;i++)
cin >> a[i];...
#include< iostream >
using namespace std;
int main()
{
int arr[10];
int no_of_elements, key;
bool found = false;
cout<<"Enter the number of element: ";
...
#include < iostream.h >
const int MAX = 10 ;
class array
{
private :
int arr[MAX] ;
int count ;
public :
array( ) ;
void add (...
#include
#include
#include
#include
int Partition(int low,int high,int arr[]);
void Quick_sort(int low,int high,int arr[]);
void main()
{
int *a,n,low,high,i;
clrscr();...
#include < iostream.h >
#include < conio.h >
#include < stdlib.h >
struct node
{
char name[20];
int age;
float height;
node *nxt;
};
node...
#include< iostream.h >
#include< conio.h >
const int MAX=5;
class pqueue
{
int front,rear;
public:
struct data
{
int val,p,o;
...
#include< iostream.h >
#include< conio.h >
const int MAX = 5;
class cqueue
{
int a[MAX],front,rear;
public :
cqueue()
{
front=rear=-1;...
Merge Two Sorted Linked List To Form A Third Linked List
Posted by Naveen's Blogs
Tag :
Data Structures,
Linked list
#include< iostream.h >
#include< conio.h >
#include< process.h >
// Creating a NODE Structure
struct node
{
int data; // data
struct node *next; // link...
#include <iostream.h>
int a[50];
void merge(int,int,int);
void merge_sort(int low,int high)
{
int mid;
if(low<high)
{
mid=(low+high)/2;
...
#include < iostream.h >
const int MAX = 10 ;
class array
{
private :
int arr[MAX] ;
int count ;
public :
array( ) ;
void add (...
Inserting, deleting and displaying elements in the Double Circular Linked List
Posted by Naveen's Blogs
Tag :
Data Structures,
Linked list
#include< iostream.h >
#include< conio.h >
class cirdlink
{
struct node
{
int data;
node *rnext;
node *lnext;
}*new1,*head,*tail,*ptr,*temp;...
#include< iostream.h>
#include< conio.h>
#define SIZE 20
class stack
{
int a[SIZE];
int tos; // Top of Stack
public:
stack();
void push(int);
...
# include < iostream.h >
# include < conio.h >
# define SIZE 20
class queue
{
int a[SIZE];
int front;
int rear;
public:
queue();
~queue();...
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
class path
{
int n;
int p[10][10];
int a[10][10];...
#include < iostream >
#include < cstdlib >
#include < string >
using namespace std;
class Dllist
{
private:
typedef struct Node
{
string...
#include< iostream >
#define INFINITY 999
using namespace std;
class Dijkstra
{
private:
int adjMatrix[15][15];
int predecessor[15],distance[15];
bool...
#include<iostream>
#include<stdlib.h>
using namespace std;
void create(); // For creating a graph
void dfs(); // For Deapth First Search(DFS) Traversal.
void bfs(); // For...
Program Limitations
* This program Only process single digit operations
* Can't handle unary operation
* Only process left to right associativity
#include< iostream >
#include<...
#include<iostream>
#include<stdlib.h>
using namespace std;
struct node
{
node *left;
int value;
node *right;
};
node *curr=NULL;
int addnode(node *, node...
AVL Tree with Insertion,Deletion and balancing Height
Posted by Naveen's Blogs
Tag :
Data Structures,
trees
#include<iostream>
#include<stdlib>
#include<conio>
using namespace std;
struct node
{
int element;
node *left;
node *right;
int height;
};
typedef...
Appending Two Linked List based upon two data members
Posted by Naveen's Blogs
Tag :
Data Structures,
Linked list
#include<iostream>
using namespace std;
class CClass1
{
public:
char mStringData[10];;
long int mDataMember1;
long int mDataMember2;
CClass1 *structpNextValue;
...
#include <iostream>
using namespace std;
template <class X>
void bubble(X *data, int size)
{
register int a, b;
X t;
for(a=1; a < size; a++)...