🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Heaps & Priority Queues Quiz: all 8 questions

Heaps & Priority Queues Quiz · Question 8 of 8

Which questions are good fits for a heap? (select all that apply)

Which questions are good fits for a heap? (select all that apply)

  1. A.Top K frequent elements
  2. B.K closest points to the origin
  3. C.Check if a string is a palindrome
  4. D.Reverse a linked list
Answer & explanation

Correct answer: Top K frequent elements · K closest points to the origin

"K-th / top K / closest K / repeatedly take the min or max" are heap signals.

Can you get the rest right without peeking?

Take the timed Heaps & Priority Queues Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →