GeeksforGeeks » Interview Questions

HEAP

(2 posts)
  • Started 7 months ago by s_malavika
  • Latest reply from anonym
  1. s_malavika
    Member
    Posted 7 months ago #

    Which one of the following array sequences forms a heap?

    a) 23,17,14,6,13,10,1,12,7,5
    b) 23,17,14,6,13,10,1,5,7,12
    c) 23,17,14,7,13,10,1,5,6,12
    d) 23,17,14,7,13,10,1,12,5,7

    Could you please explain how do we know which sequence forms a heap?

  2. anonym
    guest
    Posted 7 months ago #

    Ans. C

    make complete binary tree.


Reply

You must log in to post.

RSS feed for this topic