While scanning a file containing 1 million items once and retaining only 10…

PYQ CoCubes 2024

While scanning a file containing 1 million items once and retaining only 10 candidates, which data structure gives O(1) access to the smallest retained candidate and O(log 10) replacement time for maintaining the 10 largest items?

  1. A.

    Min-heap

  2. B.

    Max-heap

  3. C.

    BST

  4. D.

    Sorted array

Attempted by 124 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…