| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 6 Mar 2008 21:48:13 IST
|
|
|
what r the important thngs in this chapter to study for the board exams...........i find it very boring
|
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 7 Mar 2008 14:52:37 IST
|
|
|
Conversion of Infix to Postfix/Prefix (or) Evaluation of Postfix expression are some sure questions from this chapter.Plus you need to go through all the algorithms(Stack implentation,Queue Implementation,Circular queue....).
|
ANAND KRISHNAN |
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 7 Mar 2008 14:54:42 IST
|
|
|
HEY, AGREED IT IS DAMN BORING
|
GIVE LIFE THE BEST....srini...
DO OR DIE, OR BETTER NEVER TRY!!
I dont want to be the most intelligent among the ten.i pray the other nine RE fools!???!!!!!!
it doesn't matter if you win... whats important to me is i win!!!!!!!! |
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 7 Mar 2008 14:56:55 IST
|
|
|
Push and pop in linked list implemented stacks and in queues, evaluation of postfix using stacks, circular queues
|
______________________________________________
Siddhant Shah
The trouble with doing something right the first time is that nobody appreciates how difficult it is.
You can't control the wind, but you can adjust your sails.
|
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 7 Mar 2008 15:22:38 IST
|
|
|
bacha kya????
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 7 Mar 2008 15:31:33 IST
|
|
|
if u r ready to loose 3-5 marks out of 70 , then u can leave it.
but if u think that this part is boring , then don't even think about taking computer science engineering bcos a major part of the course is algorithms and it will much more difficult than stack and queues.
|
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 7 Mar 2008 15:46:11 IST
|
|
|
thnks guys........
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
|
|
|
|
if u see it ,u will find that some of them have the basic process common.so just study one of them and the others will fall in.mainly they will ask only the user defined function and not the entire prog.
!!!!!!!!!!!!!!!!!!
|
Varsha
be cool,
tomorrow is what we make it today,
so if u can dream it , u can make it .
life is an ice cream ,eat it before it melts away!!!!!!!!!
    

|
this reply: 5 points
(with 1 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 13 Mar 2008 21:59:30 IST
|
|
|
I thought the programs given in the textbook by Sumitha Arora were quite confusing. So here's a sample program I got from my school.
//Stack as an array #include<iostream.h> #include<iomanip.h> #include<process.h> #include<string.h> #include<stdio.h> #include<conio.h> struct stack { int no; char name[20]; float sal; void accept() { cout<<"\nEmployee Number: "; cin>>no; cout<<"Name : "; gets(name); cout<<"Salary : "; cin>>sal; } void output() { cout<<"\nEmployee Number: "<<no; cout<<"\nName : "<<name; cout<<"\nSalary : "<<sal; } }; void push(stack a[], int &top) { if(top==4) cout<<"\nOverflow\n"; else { top++; a[top].accept(); } } void pop(stack a[], int &top) { if(top==-1) cout<<"\nUnderflow\n"; else { cout<<"\nDeleting\n"; a[top].output(); top--; } } void display(stack a[], int top) { if(top==-1) cout<<"\nUnderflow\n"; else { int i,l; cout<<endl<<setw(60)<<setfill('-')<<" "<<endl; cout<<setw(4)<<"Employee no"<<"\t\t"<<"Employee name "<<"\t\t"<<" Salary"<<endl; cout<<setw(60)<<setfill('-')<<" "<<endl; cout<<setw(60)<<setfill(' ')<<" "<<endl; for(i=0;i<=top;i++) { l=strlen(a[i].name); cout<<setw(8)<<a[i].no<<"\t\t"<<a[i].name; cout<<setw(28-l)<<a[i].sal<<endl; } cout<<setw(60)<<setfill('-')<<" "<<endl; cout<<setw(60)<<setfill(' ')<<" "<<endl; } } void main() { clrscr(); stack emp[5]; int top=-1,op; char ch; do { cout<<"\nThe menu is:-"; cout<<"\n1.Push\n2.Pop\n3.Display\n4.Exit\n"; cout<<"Enter your choice: "; cin>>op; if(op==1) push(emp,top); if(op==2) pop(emp,top); if(op==3) display(emp,top); if(op==4) exit(0); cout<<"\nDo you want to continue? "; cin>>ch; }while(ch=='y'||ch=='Y'); }
|
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 13 Mar 2008 22:02:05 IST
|
|
|
//Stack as linked list #include<iostream.h> #include<process.h> #include<conio.h> struct stack { int no; char name[20]; stack *link; void accept() { cout<<"Enter no. & name: "; cin>>no>>name; } void output() { cout<<no<<" "<<name; } }; void push(stack *&top) { stack *temp; temp=new stack; temp->accept(); temp->link=NULL; if(top==NULL) top=temp; else { temp->link=top; top=temp; } } void pop(stack *&top) { if(top==NULL) cout<<"Underflow"; else { stack *temp; temp=new stack; temp=top; cout<<"Deleting "; temp->output(); top=top->link; delete temp; } } void display(stack *top) { if(top==NULL) cout<<"Underflow"; else { while(top) { top->output(); top=top->link; } } } void main() { stack *top; top=new stack; top=NULL; char ch; int op; do { cout<<"\n1.Push\n2.Pop\n3.Display\n4.Exit\n"; cout<<"Enter your choice "; cin>>op; if(op==1) push(top); if(op==2) pop(top); if(op==3) display(top); if(op==4) exit(0); cout<<"\nWant to continue? "; cin>>ch; }while(ch=='y'||ch=='Y'); }
|
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 13 Mar 2008 22:03:32 IST
|
|
|
//queue as an array #include<iostream.h> #include<process.h> #include<conio.h> struct queue { int no; char name[20]; void accept() { cout<<"Enter no. & name "; cin>>no>>name; } void output() { cout<<no<<" "<<name; } }; void qinsert(queue q[],int &front,int &rear,int n) { if(rear==n-1) cout<<"\nQueue is full\n"; else { if(rear==-1) front=rear=0; else rear++; q[rear].accept(); } } void qdelete(queue q[],int &front,int rear) { if(rear==-1||front==rear+1) cout<<"\nQueue is empty\n"; else { q[front].output(); front++; } } void qdisplay(queue q[],int front,int rear) { int i; for(i=front;i<=rear;i++) q[i].output(); } void main() { clrscr(); queue q[10]; int front,rear=-1,op,n; char ch; cout<<"Enter size of elements: "; cin>>n; do { cout<<"\n1.Insert\n2.Delete\n3.Display\n4.Exit\n"; cout<<"Enter your choice "; cin>>op; switch(op) { case 1: qinsert(q,front,rear,n); break; case 2: qdelete(q,front,rear); break; case 3: qdisplay(q,front,rear); break; case 4: exit(0); } cout<<"\nDo you want to continue? "; cin>>ch; }while(ch=='y'||ch=='Y'); }
|
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 13 Mar 2008 22:04:41 IST
|
|
|
//queue as linked list #include<iostream.h> #include<process.h> #include<conio.h> struct queue { int no; char name[20]; queue *link; void accept() { cout<<"Enter no. & name "; cin>>no>>name; } void output() { cout<<no<<" "<<name<<endl; } }; void qinsert(queue *&front,queue *&rear) { queue *temp; temp=new queue; temp->accept(); temp->link=NULL; if(rear==NULL) front=rear=temp; else { rear->link=temp; rear=temp; } } void qdelete(queue *&front) { if(front==NULL) cout<<"\nUnderflow\n"; else { queue *temp; temp=new queue; temp=front; temp->output(); front=front->link; delete temp; } } void qdisplay(queue *front,queue *rear) { if(front==rear) cout<<"\nQueue is empty\n"; else while(front) { front->output(); front=front->link; } } void main() { clrscr(); queue *front, *rear; front=new queue; front=NULL; rear=new queue; rear=NULL; int op; char ch; do { cout<<"\n1.Insert\n2.Delete\n3.Display\n4.Exit\n"; cout<<"Enter your choice "; cin>>op; if(op==1) qinsert(front,rear); if(op==2) qdelete(front); if(op==3) qdisplay(front,rear); if(op==4) exit(0); cout<<"\nWant to continue? "; cin>>ch; }while(ch=='y'||ch=='Y'); }
|
|
this reply: 2 points
(with 0 
in 1 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 13 Mar 2008 22:08:49 IST
|
|
|