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.

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 195
Rate it!


Answers:

Source: CoolInterview.com

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



Source: CoolInterview.com

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



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
    India News Network

    Latest 20 Questions
    Which one is not the characteristic of capitalist economy? a)Profit motive b)Income inequality c)Free employment d)Collective ownership
    A Free Market economy solves its Central Problems through_____: a)Planning authority b)Market Mechanism c)Both d)None
    If the opportunity cost is constant, then PPC would be: a)Convex b)Straight line c)Backward bending d)Concave
    Which of these would cause a rightward shift of the PPC curve? a)Improvement in technology b)Greater capital formation c)Increase in population d)All of these
    According Robbins, 'means' are: a)Scarce b)Unlimited c)Undefined d)All of these
    Bill discounted with a bank is __________ a) Contingent liability b) Current liability c) Current Asset d) None of these
    'Workmen Compensation Under Dispute' is an example of: a) Contingent Liability b) Contingent Asset c) Current Liability d) Current Asset
    Contingent liabilities are shown: a) As current liability b) As capital fund c) As footnotes to balance sheet d) As reserves
    Contingent assets usually arise from unplanned or other unexpected events: a) True b) False c) Partly True d) None
    Contingent asset is not recognized in the financial statements on the basis of _______ accounting concept: a) Prudence b) Materiality c) Substance over form d) Going concern
    The Balance on the debit side of bank column in Cash Book indicates a) Total amount withdrawn from the bank b) Total deposited in the bank c) Cash at Bank d) Bank Overdraft
    While balancing three column cash book, the discount columns are: a) Totaled but not adjusted b) Totaled and also adjusted c) Totaled but not balanced d) Balanced but not totaled
    Postage stamps purchased for Rs. 30 by business. This transaction will be recorded in: a) Purchase Book b) Cash Book c) Petty Cash Book d) Journal
    Where two aspects of a transaction are posted in the Cash Book, such an entry is called: a) Double Entry b) Debit Entry c) Credit Entry d) Contra Entry
    Rent due for the month of March will appear ________ of the cash book. a) On the receipt side b) On the payment side c) As a Contra Entry d) Nowhere
    In three column cash book, when does contra entry occurs? a) Withdrawal of cash from bank b) Payment to creditors c) Withdrawal of cash from bank for personal use d) All of the above
    Double entry in Cash Book is completed when: a) Salaries are paid by cheque b) Withdrawal of money from bank for personal use c) Deposited cash into bank d) None of these
    In petty cash book, the system followed: a) Accrual System b) Imprest System c) Cash System d) None of these
    Cheques received but deposited on the next day are recorded in: a) Cash column of the cash book b) Bank column of the cash book c) Both of these d) none of these
    What rate of commission is charged by the bank issuing the credit card: a) 1% to 3% b) 3% to 6% c) 2% to 5% d) 1% to 4%



    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 = 1.320312 Seconds