Write pseudo code for push in a stack?
Answers were Sorted based on User's Feedback
Answer / sanjeevkumar.v
push it mean INSERT the element to the STACK
| Is This Answer Correct ? | 10 Yes | 14 No |
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 |
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
What is the purpose of enum?
Why do we use inheritance?
Write an operator overloading program to Overload ‘>’ operator so as to find greater among two instances of the class.
What is the expansion of OOPS?
suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?
What is abstrac class?where is it use?
what is the new version of c++
1 Answers Ignou, Pramata, Satyam,
How Do you Code Composition and Aggregation in C++ ?
where is memory for struct allocated? where is memory for class-object allocated? I replied for struct in stack and for class-object in heap. THen he asked if class has struct member variable what happens.class on heap and what about struct in that class? couldnt ans :( :-?
what is namespace? what are the uses of namespace?
What is multilevel inheritance explain with example?