CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - 9,000 Interview Que. & Ans.
Covers 9,000+ Interview Questions asked in actual MNC Interviews - all with model answers.
Get Your Dream Job Now - www.vyoms.com
Sponsored Links
Interview Questions
Our Services

INTERVIEW QUESTIONS DATA STRUCTURE DETAILS
Question :
What is the heap?
Category Data Structure Interview Questions
Rating (3.1) By 23 users
Added on 9/13/2014
Views 174
Rate it!
Answers:

The heap is where malloc(), calloc(), and realloc() get memory.

Getting memory from the heap is much slower than getting it from the stack. On the other hand, the heap is much more flexible than the stack. Memory can be allocated at any time and deallocated in any order. Such memory isn't deallocated automatically; you have to call free().
Recursive data structures are almost always implemented with memory from the heap. Strings often come from there too, especially strings that could be very long at runtime. If you can keep data in a local variable (and allocate it from the stack), your code will run faster than if you put the data on the heap. Sometimes you can use a better algorithm if you use the heap faster, or more robust, or more flexible. Its a tradeoff.
If memory is allocated from the heap, its available until the program ends. That's great if you remember to deallocate it when you're done. If you forget, it's a problem. A �memory leak is some allocated memory that's no longer needed but isn't deallocated. If you have a memory leak inside a loop, you can use up all the memory on the heap and not be able to get any more. (When that happens, the allocation functions return a null pointer.) In some environments, if a program doesn't deallocate everything it allocated, memory stays unavailable even after the program ends.



in the heap sorting root node hold highest element after that lowest element to the root node is place at the left side and highest element placed at the right side and this process are continue until element become end.



Posted by: delanpatel

Contact delanpatel Contact delanpatel

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.
  • 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
    How can I search for data in a linked list?
    View Answer
    What is the quickest sorting method to use?
    View Answer
    Whether Linked List is linear or Non-linear data structure?
    View Answer
    Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?
    View Answer
    What is a spanning Tree?
    View Answer
    In RDBMS, what is the efficient data structure used in the internal storage representation?
    View Answer
    List out few of the Application of tree data-structure?
    View Answer
    What are the methods available in storing sequential files ?
    View Answer
    What is the data structures used to perform recursion?
    View Answer
    If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
    View Answer
    List out the areas in which data structures are applied extensively?
    View Answer
    Name the data structure used to maintain file identification?
    View Answer
    Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements.
    View Answer
    What is binary tree?
    View Answer
    What are the various kinds of sorting techniques? Which is has best case?
    View Answer
    How can a node be inserted in the middle of a linked list?
    View Answer
    How many parts are there in a declaration statement?
    View Answer
    What is Linked List ?
    View Answer
    What method is used to place a value onto the top of a stack?
    View Answer
    Why is the isEmpty() member method called?
    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

    User Options
    Latest 20 Questions
    What are the phases of the servlet life cycle?
    What are the Benefits Spring Framework ?
    What is the MVC on struts.
    What is Struts?
    Differentiate between .ear, .jar and .war files.
    How hibernate is database independent explain?
    Difference between save and saveorupdate ?
    What are the advantage of hibernate.
    What is the limitation of hibernate?
    On what basis you can arrive to an estimation for your project?
    How will you conduct Risk Analysis?
    Explain what is Test Deliverables ?
    What are the valuable steps to resolve issues while testing?
    What are the tables in testplans?
    Why we split testing into distinct stages?
    What is black box testing? What are the different black box testing techniques?
    What are the Experience-based testing techniques ?
    What are the phases of a formal review?
    Which of the following are valid objectives for incident reports?
    What are the different Methodologies in Agile Development Model?


    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0 Seconds