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

for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)

2 Answers  


why c++ is a highlevel language

3 Answers   Satyam, Tech Mahindra,


How many human genes are polymorphic?

0 Answers  


What are callback functions in c++

1 Answers   SoftTech,


What are virtual functions?

2 Answers  






define oops concept with example

1 Answers   Cap Gemini,


How is polymorphism achieved?

0 Answers  


what type of questions

0 Answers   IBM,


What is polymorphism ? Explain with examples

8 Answers   Ness Technologies,


Write a C++ program to conduct an election of a mayor.Declare a class ELECTION With the following specification: Data member: Name 25 character Age Integer symbol 1 character Member functions: To accept data for 20 contestant To accept symbol as voting from 100 voters. To declare the winner and the loser.

1 Answers   Global Academy, Infotech,


How oops is better than procedural?

0 Answers  


What do you mean by overloading?

0 Answers  


Categories