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

When a private constructer is being inherited from one class to another class and when the object is instantiated is the space reserved for this private variable in the memory??

13 Answers   HCL, Honeywell,


What is data binding in oops?

0 Answers  


Why is there no multiple inheritance?

0 Answers  


What is abstraction in oops with example?

0 Answers  


What is oops concept with example?

0 Answers  


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

1 Answers  


Polymorphism with an example?

8 Answers   Accenture, emc2,


What are the 3 pillars of oop?

0 Answers  


how does a main() in C++ is different from main() in C?

7 Answers  


What is multilevel inheritance in oop?

0 Answers  


swapping program does not use third variable

5 Answers   TCS,


WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP

2 Answers  


Categories