Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write pseudo code for push in a stack?

Answer Posted / surya8273@gmail.com

push means inserting an element on to the top of the stack.
lets define array of size 10,
int a[10]
Top<== -1 // stack is empty now.
Push(x)// x is a element to be push.lets take x=4
{
top<== top+1
// top will initialize to 1,now the top will be address to the 0 th index of array.//
a[Top]<== x
// insert x in to the 0th index of array(a[0]<== 4)//
}

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why interface is used?

1008


What is stream in oop?

1290


What are the benefits of interface?

1044


What is class and object in oops?

1127


Is oop better than procedural?

1028


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6676


Why is polymorphism used?

1031


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

2309


What is object in oop?

1106


What is solid in oops?

1115


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

2058


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

2104


what is difference between class template and template class?

2656


Get me a number puzzle game-program

2240


Which is not an object oriented programming language?

974