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 - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,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 186
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
    State the elements of marketing mix.
    What is the marketing mix?
    What is customer relationship management?
    What is relationship marketing?
    State the importance of green marketing.
    What is green marketing?
    Define M- Business.
    State the disadvantages of telemarketing.
    What are the advantages of telemarketing?
    Name the types of telemarketing.
    What is Telemarketing?
    State the recent trends in marketing.
    List out the important functions of marketing.
    Explain the approaches to marketing.
    State the various marketing goals.
    Define marketing.
    What do you mean by socio-cultural environment?
    Explain the meaning of legal environment?
    What is the definition of political environment?
    Name the personal and psychological factors influencing consumer behaviour.



    Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

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

    Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

    MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
    MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

    GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

    IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
    IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

    SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
    SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




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



    Cache = 0.015625 Seconds