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


INTERVIEW QUESTIONS DATA STRUCTURE DETAILS
Question :
What is the stack?
Category Data Structure Interview Questions
Rating (3.9) By 12 users
Added on 10/22/2004
Views 7105
Rate it!
Answers:

The stack is where all the functions? local (auto) variables are created. The stack also contains some<br>information used to call and return from functions.<br><br>A ?stack trace? is a list of which functions have been called, based on this information. When you start using a debugger, one of the first things you should learn is how to get a stack trace.<br><br>The stack is very inflexible about allocating memory; everything must be deallocated in exactly the reverse order it was allocated in. For implementing function calls, that is all that?s needed. Allocating memory off the stack is extremely efficient. One of the reasons C compilers generate such good code is their heavy use of a simple stack.<br><br>There used to be a C function that any programmer could use for allocating memory off the stack. The<br>memory was automatically deallocated when the calling function returned. This was a dangerous function to call; it?s not available anymore.



A stack is a linear data structure where insertion and deletion of an item can takes place at one end called "TOP" of the stack.And it is a LIFO(Last-in First-out) mechanism.



 Posted by: Ajay.s.m    

Contact Ajay.s.m  Contact Ajay.s.m

stack is data structure ....<br>where it works on the principle of lifo ie(last in first out)<br>eg: stack of books



 Posted by: sushanth    

Contact sushanth  Contact sushanth

stack is a part of memory.it is the storage area of automatic variables.
stack is a linear data structure where insertion and deletion takes place at only one end of it "top" and it works according to LIFO principle



 Posted by: RWEHIRU    

Contact RWEHIRU  Contact RWEHIRU

Stack is a linear data structure in which insertion and deletion are made at one end called TOP and it always initializes to -1.stack is LIFO list and it has PUSH and POP operations for insertion and deletion.insertion and deletion are made dynamically.



 Posted by: uday kumar    

Contact uday kumar  Contact uday kumar


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

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 Data Structure 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/998/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.75