what is a stack

Answer Posted / naresh lingampally

Stack is a data structure ,a last in, first out (LIFO)
abstract data type.
A stack can have any abstract data type as an element, but
is characterized by only two fundamental operations: push
and pop. The push operation adds to the top of the list,
hiding any items already on the stack, or initializing the
stack if it is empty. The pop operation removes an item from
the top of the list, and returns this value to the caller. A
pop either reveals previously concealed items, or results in
an empty list.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is ur strangth & weekness

1825


What are identifiers c?

569


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

764


What are the ways to a null pointer can use in c programming language?

592


i have a written test for microland please give me test pattern

2189






What is pass by value in c?

600


What is the use of extern in c?

651


Explain how are 16- and 32-bit numbers stored?

787


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2719


What are reserved words?

661


Is that possible to add pointers to each other?

907


What is the difference between text and binary i/o?

596


What is strcpy() function?

661


What is the difference between typedef struct and struct?

602


Explain what are the different file extensions involved when programming in c?

639