php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS301‐ Data Structures Assignment No. 1 Solution Semester Spring 2013
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#2
Idea Solution

#include<iostream.h>
#include<cstdlib>
#include<conio.h>

using namespace std;

struct node
{

string data;
int Age;
struct node *next;
};

class queue
{



public:
node *rear;
node *frnt;

queue()
{
frnt=rear=NULL;
}
void insert();
void del();
void show();
void display();
void length();

};


void queue::insert()
{

string namec;
int agec;

node *temp = new node;
cout"\nHow many node you want to create? : ";
cin>>namec;
cout"\nEEnter the name of node : ";
cin>>agec;

temp->data = namec;
temp->Age=agec;
temp->next = NULL;
if(frnt == NULL){
frnt = temp;
}else{
rear->next = temp;
}
rear = temp;

}


void queue:Confusedhow()
{
node *ptr1=frnt;
if(frnt==NULL)
{
cout"The Queue is empty!!\n";
return;
}
else
{
cout"\nCustomer at the front is : "ptr1->data "\n";

}
}

void queue::del()
{
if(frnt==NULL)
{
cout"\nSorry. Queue is empty";
return;
}
node *temp;
temp=frnt;
frnt=frnt->next;
cout"\nCustomer removed/served successfully : "temp->data ;
delete temp;

}


void queue::length()
{

int x;
x=0;
node *ptr1=frnt;
while(ptr1!=NULL)
{
ptr1=ptr1->next;
x++;
}
cout"\nTHe customers are : " x ;
}


void queue::display()
{
node *ptr1=frnt;
if(frnt==NULL)
{
cout"The Queue is empty!!";
return;
}
cout"\nThe Queue is\n";
cout "Name Age \n";

while(ptr1!=NULL)
{
cout ptr1-> data ptr1->Age "\n" ;
ptr1=ptr1->next;
}

}

int main()
{

queue q;
char choice;


while(1)
{
cout "\n1- for Enter/adding nodes in Queue";
cout "\n2- for Remove/serve a nodes";
cout "\n3- for Show nodes at front ";
cout "\n4- for Display all nodes in queue";
cout "\n5- for Show size of Queue ";
cout "\n6- for Exit";
cout "\n\nEnter your option: ";

cin>>choice;

switch(choice)
{
case '1':

char check;

do
{
q.insert();
cout"\n Do u want to enter another nodes(y/n): ";
cin>>check;
}
while(check=='y' || check=='Y');
break;
case '2':
q.del();
break;
case '3':
q.show();
break;
case '4':
q.display();
break;
case '5':
q.length();
break;
case '6':
exit(0);
break;

default:

cout"\n Sorry characters are no allowed. Please enter only option 1-6!!\n";
break;
}}

return 0;}

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Messages In This Thread
CS301‐ Data Structures Assignment No. 1 Solution Semester Spring 2013 - by Vuhelper - 04-19-2013, 10:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,369 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,957 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,989 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,228 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,294 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 2,023 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,715 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,854 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,753 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,854 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support