What are the time complexities for a priority queue implemented with a heap?

2025

What are the time complexities for a priority queue implemented with a heap?

Answer: A. Insert : θ(log n), Remove : θ(log n)

  1. A.

    Insert : θ(log n), Remove : θ(log n)

  2. B.

    Insert : θ(n), Remove : θ(1)

  3. C.

    Insert : θ(1), Remove : θ(log n)

  4. D.

    Insert : θ(log n), Remove : θ(1)

Attempted by 476 students.

Show answer & explanation

Correct answer: A

Explore the full course: Mppsc Assistant Professor Computer Science Paper 2

Loading lesson…