CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
What is the stack?



Category C Interview Questions
Rating (3.0) By 3 users
Added on 7/19/2006
Views 2230
Rate it!
Answers:

Stack is a last in first out data structure.

Compare it with a box full of books -- you can take out only the uppermost book and can put a new book only at top.

Push() is an operation which puts an element onto the stack. Pop() is an operation which returns and deletes the topmost element on the stack.

OS uses stack for function calls -- if F1() calls F2() then on the stack F1() will be below F2(). So F1() can continue execution only when F2() completes and returns control back to F1().



stack is a linear data storage representation where data is stored and retrieved by using the concept of "last in first out". i.e whichever data is entered in the stack last that data is retrieved first.



 Posted by: sreelatha    

Contact sreelatha  Contact sreelatha

Stack is the LIFO data structure. it has the two operation that is first one is push() operation and second one is the pop(). for example we take one container if container is full at the time stack is full. else container is empty at the time top is 0.



 Posted by: G.Manimarudhan    

Contact G.Manimarudhan  Contact G.Manimarudhan

IN PROGRAMMING TERMS STACK CAN BE DEFINED AS A LINEAR DATA STRUCTURE WHICH POSSESSES
LIFO(LAST IN FIRST OUT) CHARACTERISTIC.HERE
THE ELMENT WHICH ENTERS THE STACK LEAVES IT
AT LAST BY THE PROCESS OF POPPING & ADDITION
OF ELEMENTS CAN TAKE PLACE BY PUSHING IT INTO THE STACK PROVIDED THE STACK IS NOT FULL.



 Posted by: ANIRUDDHA    

Contact ANIRUDDHA  Contact ANIRUDDHA

A stack is an ordered collection of elements in which insertion and deletion are restricted to one end. The end from which element is added and/or removed is reffered to as top of the stack.The first element placed in the stack will be at the bottom of the stack.hence stack is reffered to as Last-in-First out(LIFO)lists.



 Posted by: gunasekar    

Contact gunasekar  Contact gunasekar


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is a null pointer?


View Answer
How can I convert a number to a string?


View Answer
What is the difference between #include <file> and #include ?file??


View Answer
What is Preprocessor?


View Answer
What is the difference between text and binary modes?


View Answer
What is the benefit of using const for declaring constants?


View Answer
What is the difference between declaring a variable and defining a variable?


View Answer
What is a const pointer?
View Answer
What is an lvalue?


View Answer
When is a switch statement better than multiple if statements?


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6065/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.64