Computer Science I / Integrated Algorithm Design Practice
Practice question · Select all that apply

For 'find the k most frequent words in a huge text', select every design decision the lesson endorses.

Hints
  1. The design deliberately avoids one of these, and does not need another.
  2. Sorting everything is what the heap is there to avoid; counting is not a DP problem.
Show the answer
  • C. Select the top k with a heap of size k
  • D. Count frequencies with a hash table
  • E. Justify the design by analysing its complexity
Why

Hash-table counting, size-k heap selection, and complexity justification are the endorsed decisions. A full sort is what the heap avoids, and counting words is a simple pass, not a DP problem.

Read the lesson: Integrated Algorithm Design Practice →

Practise Integrated Algorithm Design Practice

The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Integrated Algorithm Design Practice