Question Bank

JavaScript Top-N Numbers (Preserving Order): Two Approaches Quiz

Difficulty: Hard

Return the N largest numbers from an array while keeping their original order, two ways (sort-and-filter-back and threshold partition), plus two companions on ties and a heap-style streaming variant.

Question Bank
/

JavaScript Top-N Numbers (Preserving Order): Two Approaches Quiz

JavaScript Top-N Numbers (Preserving Order): Two Approaches Quiz

Return the N largest numbers from an array while keeping their original order, two ways (sort-and-filter-back and threshold partition), plus two companions on ties and a heap-style streaming variant.

Question Bank
Hard
JavaScript
quiz
arrays
sorting
array-manipulation-patterns

613 views

8

This question bank is available for premium members only.

Upgrade to Premium