retagged by
353 views
2 votes
2 votes
operation on the list in this order  O(sqrt n)insert,O(nlog n) decrease key ,O(n) find operations. What is the time complexity of all these operations put together ?
retagged by

1 Answer

1 votes
1 votes

I am assuming that linked list is unsorted.

Insert - O(1), insert at the beginning of the linked list, total cost= O(sqrtn)

Decrease Key - O(1), assuming that pointer to the node is provided, total cost = O(nlogn)

Find Operation - O(n), total cost = $O(n^2)$

edited

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
1 answer
3
NeelParekh asked Jul 27, 2023
277 views
If an array is split in the form of increasing and decreasing order then what is TC to find minimum element in the array?
2 votes
2 votes
1 answer
4
h4kr asked Dec 30, 2022
465 views
What is the correct time complexity in $\theta()$ ?