Write pseudo code for push in a stack?

Answers were Sorted based on User's Feedback



Write pseudo code for push in a stack?..

Answer / sanjeevkumar.v

push it mean INSERT the element to the STACK

Is This Answer Correct ?    10 Yes 14 No

Write pseudo code for push in a stack?..

Answer / 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

More OOPS Interview Questions

Write 7 differences between "Public" function and "Private" function?

2 Answers   IBM, Wipro,


How to overload postfix operator in c++

1 Answers   Mphasis,


Is enum a class?

0 Answers  


What is object and class in oops?

0 Answers  


2. Give the different notations for the class.\

0 Answers  






what is difference between objects and function

3 Answers  


what is static?

4 Answers  


4. What do you mean by a prototype? Define analysis prototype

1 Answers  


How can we use the preprocessor #if and #elseif.

2 Answers  


Describe what an Interface is and how it?s different from a Class.

7 Answers   Spinsys,


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

2 Answers  


i had specified the access specifier for abstarct class member like (pure virtual function) as private.But it can be accessed by the derived class.How the private member of one class is accessed by other class.if any body face this problem and found the solution plz reply to me.

1 Answers   Syntel,


Categories