Concept:
A data stream continuously generates data items.
To efficiently find the largest element at any time, a data structure should support:
• Fast insertion
• Fast retrieval of maximum value
A Max Heap satisfies these requirements.
Step 1: Recall Heap Property.
In a Max Heap:
\[
\text{Parent} \ge \text{Children}
\]
Therefore the largest element is always stored at the root.
Step 2: Analyze efficiency.
Insertion:
\[
O(\log n)
\]
Finding maximum:
\[
O(1)
\]
Hence heaps are highly suitable for data streams.
Step 3: Compare with other structures.
Linked lists require linear search.
Splay trees and 2-3 trees can perform the task, but heaps are the standard structure used for continuously maintaining largest values.
Step 4: Write the answer.
Therefore,
\[
\boxed{\text{Heap}}
\]
is the correct choice.
Hence option (B) is correct.
Was this answer helpful?
0
0
Top TS PGECET Computer Science & Information Technology Questions