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 |
Write 7 differences between "Public" function and "Private" function?
How to overload postfix operator in c++
Is enum a class?
What is object and class in oops?
2. Give the different notations for the class.\
what is difference between objects and function
what is static?
4. What do you mean by a prototype? Define analysis prototype
How can we use the preprocessor #if and #elseif.
Describe what an Interface is and how it?s different from a Class.
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
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.