BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Information Technology > BsIT 3rd Semester > Data Structure

Data Structure Lectures by Sir Ahsan..


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1  
Old 16-09-2008, 11:14 PM
shmsa's Avatar
Grown up punk

 
Join Date: Oct 2007
Location: Muslim Town Multan
Posts: 195
Contact Number: 0322-6196713
Program / Discipline: BSIT
Class Roll Number: 07-22
shmsa is a jewel in the roughshmsa is a jewel in the roughshmsa is a jewel in the roughshmsa is a jewel in the rough
lectures Program of STACK

Code:
#include<iostream.h>
void push(int stack[], int &top)
{
 int element;
if (top==4)
cout<<""<<endl;
else
{
 cout<<"enter element to puch in stack===="<<endl;
 cin>>element;
top++;
stack[top]=element;
}
}
void pop(int stack[],int &top)
{
 if (top==-1)
  cout<<"stack is empty"<<endl;
 else
 {
 cout<<"poped element of stack is===="<<stack[top]<<endl;
 top--;
 }
}
void show(int stack[], int &top)
{
 for (int i=top;i>=0;i--)
  cout<<stack[i]<<endl;
}
void main()
{
 char opt='y';
 int stack[5];
 int top=-1;
 while (opt=='y')
 {
  cout<<"enter 'P' for PUSH"<<endl<<"enter 'O' for POP"<<endl<<"enter 'S' for SHOW"<<endl;
  cin>>opt;
  if (opt=='p')
   push(stack,top);
  else
   if (opt=='o')
    pop(stack,top);
   else
   if (opt=='s')
    show(stack,top);
   else
    cout<<"you have entered werong character"<<endl;
   cout<<"DO you want more y/n"<<endl;
   cin>>opt;
 }//end of while
}// end of main

Reply With Quote
  #2  
Old 17-09-2008, 01:02 AM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Program of STACK

Thanks Shahrukh
Reply With Quote
  #3  
Old 17-09-2008, 01:06 AM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Default Re: Program of STACK

Thanks for sharing Shamsa...
I really appreciate for this sharing...
Actually humaray latop say na yeh delete ho gai thei.
__________________
(`v)
`*..*`

.*.*) .*)
(.* (.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
  #4  
Old 17-09-2008, 11:57 AM
Danish Hussain's Avatar
Teenager

 
Join Date: Oct 2007
Location: Multan
Posts: 89
Contact Number: 061-111-11-9393
Program / Discipline: ------
Class Roll Number: 07-09
Danish Hussain will become famous soon enough
Send a message via Yahoo to Danish Hussain Send a message via Skype™ to Danish Hussain
Default Re: Program of STACK

to ab dobara save kar lo naa...loatop mei
__________________
DanishHussain.NET
Reply With Quote
  #5  
Old 06-10-2008, 02:04 AM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Program of STACK

Dear! It's not executing
Can you please attach the original file .
Reply With Quote
  #6  
Old 06-10-2008, 03:56 PM
BSIT07-01's Avatar
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Default Re: Program of STACK

I have attached the source file of Stack program.
download it.
Attached Files
File Type: txt stack.txt (987 Bytes, 211 views)
Reply With Quote
  #7  
Old 09-10-2008, 04:11 AM
.BZU.'s Avatar


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Default Re: Program of STACK

Quote:
Originally Posted by UNKNOWN View Post
I have attached the source file of Stack program.
download it.
Problem was on the site...
and now that issue has been resolved...
Abh shamsa wala bhi execute karay ga... Insha Allah

Now I am happy... Because I have done all ...
Just only losing two posts....
Otherwise humari saari posted assignment kharab honay ka khatra tha...

Thanks GoD
__________________
(`v)
`*..*`

.*.*) .*)
(.* (.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote
Reply

Tags
c++, lectures, program, stack


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SS7 + Stack bonfire ATM Systems in Telecommunications 0 26-03-2011 01:26 AM
SS7 Protocol Stack bonfire Digital Telephony 0 10-12-2010 04:45 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 03:38 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.