CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies

Search Interview Questions

Question: What is the stack?

Answer: 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.



Category Data Structure Interview Questions & Answers - Exam Mode / Learning Mode
Rating (3.8) By 19 users
Added on 10/22/2009
Views 7248
Rate it!
Question: What is the stack?
Answer:

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. Source: CoolInterview.com


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. Source: CoolInterview.com

Answered by: Ajay.s.m | Date: 2/16/2009 | 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 Source: CoolInterview.com

Answered by: sushanth | Date: 7/22/2009 | 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 Source: CoolInterview.com

Answered by: RWEHIRU | Date: 1/13/2010 | 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. Source: CoolInterview.com

Answered by: uday kumar | Date: 2/5/2010 | Contact uday kumar Contact uday kumar

stack is a linear data structure in which insertions and deletions can take only at one end.Push and pop are two operations associated with stack.Push means to insert and pop means to remove an element from the top of stack.It is a LIFO list.Stacks are used to store variables and instructions during execution of the program. Source: CoolInterview.com

Answered by: surabhi shrivastava | Date: 2/17/2010 | Contact surabhi shrivastava Contact surabhi shrivastava

Stack is a linear, non-primitive data structure.The PUSH(insrtion) and POP(deletion)operations are performed at only one end that is pointed by a variable called TOP.It is a data structure based on the LIFO(last-in,first-out) Mechanism. Source: CoolInterview.com

Answered by: Anjali Bhatt | Date: 2/19/2010 | Contact Anjali Bhatt Contact Anjali Bhatt

Stack is a linear data-structure which operates as LIFO(last-in-first-out)manner.which contains PUSH(),POP() as standard subroutines and SEEK() as non-standard subroutine.And also it contain all the recursive calls information in the LIFO order. Source: CoolInterview.com

Answered by: kumaraswamy dapa | Date: 3/1/2010 | Contact kumaraswamy dapa Contact kumaraswamy dapa

a stack is a linear data structure in which insertion and deletion only at one end called the top of the stack. this means, in particular that elements are removed from a stack in the reverse order in which they particular by means. it is performed on LIFO function.
stack is performed on two operations:
1.PUSH:- PUSH is the used to insert an item into stack.
2.POP:-POP is the term used to delete an item from stack. Source: CoolInterview.com

Answered by: prabhat chaudhary | Date: 3/9/2010 | Contact prabhat chaudhary Contact prabhat chaudhary

stack is ordered data structure.
Stack operations are based on LIFO(LAST IN FIRST OUT)concepts.
There are mainly two operations. they are,
1.PUSH-insert element into stack
2.POP0- remove elements form stack
insertion and deletion take at one end is known as TOP. Source: CoolInterview.com

Answered by: thinagar | Date: 8/6/2010 | Contact thinagar Contact thinagar


If you have the better answer, then send it to us. We will display your answer after the approval

Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.

Post your answer here

Inform me about updated answers to this question.
Related Questions
View Answer

Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

View All Data Structure Interview Questions & Answers - Exam Mode / Learning Mode




India News Network
Latest 20 Questions
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
"Holiday Packages" announced as an advertisement are an example of _________: (a) Offer (b) Counter Offer (c) Invitation to Offer (d) None of the above
A match fixing contract between a player and a broker is a: (a) Valid Contract (b) Unenforceable Contract (c) Void Contract (d) Illegal Contract
When a bookseller sells a book on cash payment then it is called as ___________: (a) Unilateral Contract (b) Bilateral Contract (c) Executed Contract (d) Executory Contract
____________ agreements are created by situation: (a) Written (b) Oral (c) Void (d) Implied
Cache = 0.047119 Seconds