+1 vote
in Data Structures & Algorithms I by (110k points)
What is the time complexity to insert a node based on position in a priority queue?

(a) O(nlogn)

(b) O(logn)

(c) O(n)

(d) O(n^2)

My query is from Priority Queue in portion Abstract Data Types of Data Structures & Algorithms I

I have been asked this question in quiz.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
Right option is (c) O(n)

The explanation is: In the worst case, you might have to traverse the entire list.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...