Wednesday, 20 February 2019

C++ Program to maintain Student Information using File



C++ Program to maintain Student Information using File


#include <iostream>
#include<fstream>
#include<cstring>
#include<string.h>
#include<iomanip>
using namespace std;
const int MAX=20;
class Student
{
 int rollno;
 char name[20],city[20];
 char div;
 int year;
public:
 Student()
{
  strcpy(name,"");
  strcpy(city,"");
  rollno=year=div=0;
}
 Student(int rollno,char name[MAX],int year,char div,char city[MAX])
 {
  strcpy(this->name,name);
  strcpy(this->city,city);
  this->rollno=rollno;
  this->year=year;
  this->div=div;
 }
 int getRollNo()
 {
  return rollno;
 }
 void displayRecord()
 {

  cout<<endl<<setw(5)<<rollno<<setw(20)<<name<<setw(5)<<year<<setw(5)<<div<<setw(10)<<city;
 }
};
//==========File Operations ===========
class FileOperations
{
 fstream file;
public:
 FileOperations(char* filename)
{
ofstream newFile(filename,ios::app|ios::binary);
file.open(filename,ios::in|ios::out|ios::ate|ios::binary);
}
 void insertRecord(int rollno, char name[MAX],int year, char div,char city[MAX])
 {
  Student s1(rollno,name,year,div,city);
  file.seekp(0,ios::end);
  file.write((char *)&s1,sizeof(Student));
  file.clear();
 }
 void displayAll()
 {
  Student s1;
  file.seekg(0,ios::beg);
  while(file.read((char *)&s1, sizeof(Student)))
  {
   s1.displayRecord();
  }
  file.clear();
 }
 void displayRecord(int rollNo)
 {
  Student s1;
  file.seekg(0,ios::beg);
  bool flag=false;
  while(file.read((char*)&s1,sizeof(Student)))
  {
   if(s1.getRollNo()==rollNo)
   {
    s1.displayRecord();
    flag=true;
    break;
   }
  }
  if(flag==false)
  {
   cout<<"\nRecord of "<<rollNo<<"is not present.";
  }
  file.clear();
 }
 void deleteRecord(int rollno)
 {
  ofstream outFile("new.dat",ios::binary);
  file.seekg(0,ios::beg);
  bool flag=false;
  Student s1;

  while(file.read((char *)&s1, sizeof(Student)))
  {
   if(s1.getRollNo()==rollno)
   {
    flag=true;
    continue;
   }
   outFile.write((char *)&s1, sizeof(Student));
  }
  if(!flag)
  {
   cout<<"\nRecord of "<<rollno<<" is not present.";
  }
  file.close();
  outFile.close();
  remove("student1.dat");
  rename("new.dat","student1.dat");
  file.open("student1.dat",ios::in|ios::out|ios::ate|ios::binary);
 }
 ~FileOperations()
 {
  file.close();
  cout<<"\nFile Closed.";
 }
};
int main()
{

     FileOperations file((char*)"student1.dat");
     int rollNo,year,choice=0;
     char div;
     char name[MAX],address[MAX];
     while(choice!=5)
     {

         cout<<"\n*****Student Database*****\n";
         cout<<"1) Add New Record\n";
         cout<<"2) Display All Records\n";
         cout<<"3) Display by RollNo\n";
         cout<<"4) Deleting a Record\n";
         cout<<"5) Exit\n";
         cout<<"Choose your choice : ";
         cin>>choice;
         switch(choice)
         {
             case 1 : //New Record
               cout<<endl<<"Enter RollNo and name : \n";
               cin>>rollNo>>name;
               cout<<"Enter Year and Division : \n";
               cin>>year>>div;
               cout<<"Enter address : \n";
               cin>>address;
               file.insertRecord(rollNo,name,year,div,address);
               cout<<"\nRecord Inserted.";
               break;
             case 2 :
              cout<<endl<<setw(5)<<"ROLL"<<setw(20)<<"NAME"<<setw(5)<<"YEAR"<<setw(5)<<"DIV"<<setw(10)<<"CITY";
               file.displayAll();
               break;
             case 3 :
               cout<<"Enter Roll Number";
               cin>>rollNo;
                file.displayRecord(rollNo);

               break;
             case 4:
               cout<<"Enter rollNo";
               cin>>rollNo;
               file.deleteRecord(rollNo);
               break;
            case 5 :break;
         }

     }

 return 0;
}

Output



*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 1

Enter RollNo and name : 
1
a
Enter Year and Division : 
1
a
Enter address : 
pune

Record Inserted.
*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 1

Enter RollNo and name : 
2
b
Enter Year and Division : 
1
b
Enter address : 
pune

Record Inserted.
*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 2

 ROLL                NAME YEAR  DIV      CITY
    1                   a    1    a      pune
    2                   b    1    b      pune
*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 3
Enter Roll Number2

    2                   b    1    b      pune
*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 4
Enter rollNo1

*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 2

 ROLL                NAME YEAR  DIV      CITY
    2                   b    1    b      pune
*****Student Database*****
1) Add New Record
2) Display All Records
3) Display by RollNo
4) Deleting a Record
5) Exit
Choose your choice : 

C++ program for heap sort

C++ program for heap sort



#include <iostream>
#include <iomanip>
using namespace std;

int left(int i)
{
      return 2*i+1;
}
int right(int i)
{
      return 2*i+2;
}
void minheapify(int arr[], int n, int i)
{
      int l, r,smallest,temp;
      l = left(i);
      r = right(i);
      if(l<n && arr[l] < arr[i])
            smallest = l;
      else
            smallest = i;
      if(r<n && arr[r] < arr[smallest])
            smallest = r;

      if(smallest != i)
      {
            temp = arr[i];
            arr[i] = arr[smallest];
            arr[smallest] = temp;
            minheapify(arr,n,smallest);
      }
}

void heapSort(int arr[], int n)
{
      int i,temp;

      for (i = n / 2 - 1; i >= 0; i--)
            minheapify(arr, n, i);

      for (i=n-1; i>=0; i--)
      {
            temp=arr[0];
            arr[0]=arr[i];
            arr[i]=temp;
            minheapify(arr, i, 0);
      }
}

int main()
{
      int arr[20];
      int i=0,n;

      cout<<"Enter the size of array : ";
      cin>>n;
      cout<<"\nEnter the elements : ";
      for(i=0;i<n;i++)
            cin>>arr[i];

      for(i=(n-1)/2;i>=0;i--)
            minheapify(arr,n,i);

      cout<<"\nArray after Minheap \n";

      for(i=0;i<n;i++)
            cout<<arr[i]<<"  ";

      heapSort(arr, n);

      cout<<"\nArray after Heap sort \n";

            for(i=n-1;i>=0;i--)
                  cout<<arr[i]<<"  ";
      return 0;
}

 Output


Enter the size of array : 7

Enter the elements : 48
0
-1
82
10
2
100

Array after Minheap
-1  0  2  82  10  48  100 
Array after Heap sort
-1  0  2  10  48  82  100 

C++ Program for implementation of dictionary using AVL Tree


C++ Program for implementation of dictionary using AVL Tree

#include <iostream>
#include <iomanip>
using namespace std;

class node
{
 int key;
 string meaning;
 node *left,*right;
 int height;
public:
 node()
{
  left=right=NULL;
  height=1;
  meaning="";
  key=-1;
}
 node(int key,string meaning)
 {
  this->key=key;
  this->meaning=meaning;
  left=right=NULL;
  height=1;
 }

 friend class Dictionary;
};
class Dictionary
{
 node *root;
public:
 Dictionary()
{
  root=NULL;
}
 int max(int,int);
 int getheight(node*);
 node *insert(node *rnode,int key,string meaning);
 void insertInit(int key,string meaning);
 node *rightRotate(node *);
 node *leftRotate(node *);
 int getbalance(node*);
 void preorder();
 void preorderRec(node*);
 void postorder();
 void postorderRec(node *);
 void inorder();
 void inorderRec(node *);
};
int Dictionary::max(int a,int b)
{
 return (a>b)?a:b;
}
int Dictionary::getheight(node *nnode)
{
 if(nnode==NULL)
  return 0;
 else
  return nnode->height;
}
int Dictionary::getbalance(node *n)
{
 if(n==NULL)
  return 0;
 else
  return (getheight(n->left)-getheight(n->right));
}
node* Dictionary::rightRotate(node *y)
{
 node *x=y->left;
 node *xr=x->right;

 //Update Pointers after rotation
 x->right=y;
 y->left=xr;

 y->height=max(getheight(y->left),getheight(y->right))+1;
 x->height=max(getheight(x->left),getheight(x->right))+1;
 return x;
}

node* Dictionary::leftRotate(node *y)
{
 node *x=y->right;
 node *t2=x->left;

 x->left=y;
 y->right=t2;

 y->height=max(getheight(y->left),getheight(y->right))+1;
 x->height=max(getheight(x->left),getheight(x->right))+1;

 return x;
}

node* Dictionary::insert(node *rnode,int key,string meaning)
{
 //1. Normat BST Operation
 if(rnode==NULL) //Empty Dictionary
  return new node(key,meaning);

 if(key<rnode->key)
  rnode->left=insert(rnode->left,key,meaning);
 else if(key>rnode->key)
  rnode->right=insert(rnode->right,key,meaning);
 else //equal value key
  return rnode;

 //2. update height of ancestors
 rnode->height=1+max(getheight(rnode->left),getheight(rnode->right));
 //3. Get balancing factor
 int balance=getbalance(rnode);

 //4. perform rotations and return nre root
 //LL Case
 if(balance>1 && key<rnode->left->key)
  return rightRotate(rnode);

 //RR Case
 if(balance<-1 && key>rnode->right->key)
  return leftRotate(rnode);

 //LR Case
 if(balance>1 && key>rnode->left->key)
 {
  rnode->left=leftRotate(rnode->left);
  return rightRotate(rnode);
 }

 //RL Case
 if(balance<-1 && key<rnode->right->key)
 {
  rnode->right=rightRotate(rnode->right);
 return leftRotate(rnode);
 }

 return rnode; //no change in root

}
void Dictionary::preorder()
{
 preorderRec(root);
}
void Dictionary::postorder()
{
 postorderRec(root);
}
void Dictionary::inorder()
{
 inorderRec(root);
}
void Dictionary::preorderRec(node *n)
{
 if(n)
 {
  cout<<endl<<n->key<<"   "<<n->meaning;
  preorderRec(n->left);
  preorderRec(n->right);
 }
}

void Dictionary::inorderRec(node *n)
{
 if(n)
 {
  inorderRec(n->left);
  cout<<endl<<n->key<<"   "<<n->meaning;
  inorderRec(n->right);
 }
}

void Dictionary::postorderRec(node *n)
{
 if(n)
 {
  postorderRec(n->left);
  postorderRec(n->right);
  cout<<endl<<n->key<<"   "<<n->meaning;
 }
}
void Dictionary::insertInit(int key,string meaning)
{
 root=insert(root,key,meaning);
}
int main() {
 Dictionary d;
 d.insertInit(10,"Apple");
 d.insertInit(20,"Banana");
 d.insertInit(30,"Orange");
 d.insertInit(40,"Grapes");
 d.insertInit(50,"Papaya");

 cout<<"\nASCENDING ORDER:";
 d.inorder();

 cout<<"\nPreorder: ";
 d.preorder();

 cout<<"\nPostorder: ";
 d.postorder();

 return 0;
}

Output



ASCENDING ORDER:
10   Apple
20   Banana
30   Orange
40   Grapes
50   Papaya
Preorder: 
20   Banana
10   Apple
40   Grapes
30   Orange
50   Papaya
Postorder: 
10   Apple
30   Orange
50   Papaya
40   Grapes
20   Banana

C++ Program to Implement OBST

C++ Program to Implement OBST


#include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;
#define MAX 10


int main()
{
int w[MAX][MAX], c[MAX][MAX], r[MAX][MAX], p[MAX], q[MAX];
int temp=0, root, min, min1, n;
int i,j,k,b;

cout<<"Enter the number of elements:";
cin>>n;
cout<<"\n";
for(i=1; i <= n; i++)
{
cout<<"Enter the Element ";
cin>>p[i];
}
cout<<"\n";
for(i=0; i <= n; i++)
{
cout<<"Enter the Probability ";
cin>>q[i];
}

for(i=0; i <= n; i++)
{
for(j=0; j <= n; j++)
{

w[i][j] = 0;
c[i][j] = 0;
r[i][j] = 0;
}
}

for(i=0; i <= n; i++)
{
for(j=0; j <= n; j++)
{
if(i == j)
{
w[i][j] = q[i];
c[i][j] = 0;
r[i][j] = 0;
}
}
}

for(b=0; b < n; b++)
{
for(i=0,j=b+1; j < n+1 && i < n+1; j++,i++)
{
if(i!=j && i < j)
{
w[i][j] = p[j] + q[j] + w[i][j-1];

min = 30000;
for(k = i+1; k <= j; k++)
{
min1 = c[i][k-1] + c[k][j] + w[i][j];
if(min > min1)
{
min = min1;
temp = k;
}
}
c[i][j] = min;
r[i][j] = temp;
}
}
}
printf("Minimum cost = %d\n",c[0][n]);
root = r[0][n];
printf("Root  = %d \n",root);

cout<<"\n**Weight matrix***\n";
for(i=0; i <= n; i++)
{
for(j=0; j <= n; j++)
{
cout<<w[i][j]<<"\t";
}
cout<<"\n";
}
cout<<"\n**Cost matrix***\n";
for(i=0; i <= n; i++)
{
for(j=0; j <= n; j++)
{
cout<<c[i][j]<<"\t";
}
cout<<"\n";
}
cout<<"\n**Root matrix***\n";
for(i=0; i <= n; i++)
{
for(j=0; j <= n; j++)
{
cout<<r[i][j]<<"\t";
}
cout<<"\n";
}

return 0;

}

Output


Enter the number of elements:6

Enter the Element 10
Enter the Element 3
Enter the Element 9
Enter the Element 2
Enter the Element 0
Enter the Element 10

Enter the Probability 5
Enter the Probability 6
Enter the Probability 4
Enter the Probability 4
Enter the Probability 3
Enter the Probability 8
Enter the Probability 0
Minimum cost = 158
Root  = 3 

**Weight matrix***
5 21 28 41 46 54 64
0 6 13 26 31 39 49
0 0 4 17 22 30 40
0 0 0 4 9 17 27
0 0 0 0 3 11 21
0 0 0 0 0 8 18
0 0 0 0 0 0 0

**Cost matrix***
0 21 41 79 96 121 158
0 0 13 39 53 78 115
0 0 0 17 31 56 89
0 0 0 0 9 26 53
0 0 0 0 0 11 32
0 0 0 0 0 0 18
0 0 0 0 0 0 0

**Root matrix***
0 1 1 2 3 3 3
0 0 2 3 3 3 3
0 0 0 3 3 3 4
0 0 0 0 4 5 6
0 0 0 0 0 5 6
0 0 0 0 0 0 6
0 0 0 0 0 0 0

Thursday, 14 February 2019

C++ Program for implementation of Symbol Table using Hashing


C++ Program for implementation of Symbol Table using Hashing



#include <iostream>
#include <cstring>
using namespace std;

const int MAX=10;
class dictionary;
class node
{
string identifier,scope,type;
int lineNo;
node *next;
public:
friend class SymbolTable;
node()
{
next=NULL;
}
node(string key,string value,string type,int lineNo)
{
this->identifier=key;
this->scope=value;
this->type=type;
this->lineNo=lineNo;
next=NULL;
}
};

class SymbolTable
{
node *head[MAX];
public:
SymbolTable()
{
for(int i=0;i<MAX;i++)
head[i]=NULL;
}
int hashf(string id);
void insert(string id,string scope,string Type,int lineno);
void find(string id);
bool deleteRecord(string id);
void modify(string id);
void display();
};


int SymbolTable::hashf(string id)
{
int asciiSum=0;
for(int i=0;i<id.length();i++)
{
asciiSum=asciiSum+id[i];
}
return (asciiSum%10);
}

void SymbolTable::insert(string id,string scope,string Type,int lineno)
{
int index=hashf(id);
node *p=new node(id,scope,Type,lineno);

if(head[index]==NULL)
{
head[index]=p;
}
else
{
node *start=head[index];
while(start->next!=NULL)
start=start->next;
start->next=p;

}
cout<<endl<<id<<" inserted into Symbol Table.";

}

void SymbolTable:: display()
{
cout<<"\nIndex\tID\tScope\tType\tLineno";
for(int i=0;i<10;i++)
{
node *start=head[i];
if(start==NULL)
cout<<"\n";
while(start!=NULL)
{
cout<<"\n"<<i<<" :\t"<<start->identifier<<"\t"<<start->scope<<"\t"<<start->type<<"\t"<<start->lineNo;
start=start->next;
}
}
}

void SymbolTable::find(string id)
{
int index=hashf(id);
int flag=0;
node *start=head[index];
while(start!=NULL)
{
if(start->identifier==id)
{
//start->print();
flag=1;
break;

}
start=start->next;
}
if(flag==1)
cout<<"Id Is  present.";
else
cout<<"Id Is not present.";
}

void SymbolTable::modify(string id)
{
int index=hashf(id);
node *start=head[index];
int flag=0;
while(start!=NULL)
{
if(start->identifier==id)
{
cout<<id<<" is present\n";
cout<<"Enter Scope: ";
cin>>(start->scope);
cout<<"Enter Type: ";
cin>>(start->type);
cout<<"Enter Line Number: ";
cin>>(start->lineNo);
flag=1;
}start=start->next;
}
if(flag==1)
cout<<"record modified";
else
cout<<"No record modified";

}

bool SymbolTable::deleteRecord(string id)
{
int index=hashf(id);
node *tmp=head[index];
node *par=head[index];
if(tmp==NULL) //if no identifier is present at that index
{
return false;
}
if(tmp->identifier==id && tmp->next==NULL)//only one identifier is present
{
head[index]=NULL;
delete tmp;
return true;
}
//tmp=tmp->next;
while(tmp->identifier!=id && tmp->next!=NULL)
{
par=tmp;
tmp=tmp->next;
}
if(tmp->identifier==id&&tmp->next!=NULL)
{

if(par-> identifier ==tmp-> identifier)
          {
              head[index]=tmp->next;
          }
          else
          {
            par->next=tmp->next;
            tmp->next=NULL;
          }

delete tmp;
return true;
}
else //delete at end
{
par->next=NULL;
tmp->next=NULL;
delete tmp;
return true;
}
return false;
}



int main() {
SymbolTable  st;
int choice,lineno;
string id,scope,type;
do
{
cout<<"\n**** SYMBOL_TABLE ****\n"
<<"1.Insert Identifier\n"
<<"2.Find Identifier\n"
<<"3.Delete identifier\n"
<<"4.Modify attributes\n"
<<"5.Display\n"
<<"Enter Your Choice :";
cin>>choice;
switch(choice)
{
case 1:
cout<<"Enter Identifer's Name: ";
cin>>id;
cout<<"Enter Scope: ";
cin>>scope;
cout<<"Enter Type: ";
cin>>type;
cout<<"Enter Line Number: ";
cin>>lineno;
st.insert(id,scope,type,lineno);
break;
case 2:
cout<<"Enter Identifier to Search: ";
cin>>id;
st.find(id);
break;
case 3:
cout<<"Enter Identifier to Delete: ";
cin>>id;
if(st.deleteRecord(id))
cout<<" Identifier's Record is deleted.";
else
{
cout<<"\nFailed to delete "<<id;
}
break;
case 4:
cout<<"Enter Identifier to Modify: ";
cin>>id;
st.modify(id);
break;
case 5:
cout<<"***Symbol Table***";
st.display();
break;
default:
cout<<"\nWrong Choice.";
}

}while(choice!=0);

return 0;
}


output:

**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :1
Enter Identifer's Name: abc
Enter Scope: a
Enter Type: a
Enter Line Number: 1

abc inserted into Symbol Table.
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :1
Enter Identifer's Name: bca
Enter Scope: b
Enter Type: b
Enter Line Number: 2

bca inserted into Symbol Table.
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :1
Enter Identifer's Name: cba
Enter Scope: c
Enter Type: c
Enter Line Number: 2

cba inserted into Symbol Table.
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :5
***Symbol Table***
Index ID Scope Type Lineno




4 : abc a a 1
4 : bca b b 2
4 : cba c c 2





**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :3
Enter Identifier to Delete: bca
 Identifier's Record is deleted.
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :5
***Symbol Table***
Index ID Scope Type Lineno




4 : abc a a 1
4 : cba c c 2





**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :3
Enter Identifier to Delete: cba
 Identifier's Record is deleted.
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :5
***Symbol Table***
Index ID Scope Type Lineno




4 : abc a a 1





**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :4
Enter Identifier to Modify: abc
abc is present
Enter Scope: a
Enter Type: a
Enter Line Number: 3
record modified
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :5
***Symbol Table***
Index ID Scope Type Lineno




4 : abc a a 3





**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :3
Enter Identifier to Delete: abc
 Identifier's Record is deleted.
**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :5
***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***Symbol Table***
Index ID Scope Type Lineno










**** SYMBOL_TABLE ****
1.Insert Identifier
2.Find Identifier
3.Delete identifier
4.Modify attributes
5.Display
Enter Your Choice :***S

Stack and Queue as ADT in C++

Stack as ADT The functions associated with stack are: empty()  – Returns whether the stack is empty size()  – Returns the size o...