0 votes 0 votes Algorithms dijkstras-algorithm sorting time-complexity test-series + – Isha Karn asked Dec 5, 2014 retagged Jul 14, 2022 by makhdoom ghaya Isha Karn 356 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes Here, because of adjacency matrix it will take V2 and because of linked list we have to traverse all nodes therefore it will take V time. hence O(V3) jayendra answered Dec 6, 2014 jayendra comment Share Follow See all 2 Comments See all 2 2 Comments reply dhingrak commented Dec 12, 2014 reply Follow Share Can you please explain if the list is sorted in ascending order then time to remove min element(one at front) would be O(1) So shouldn't the answer will be O(V^2) 0 votes 0 votes preeti0448 commented Aug 31, 2022 reply Follow Share We also have to travel ‘V’ nodes to decrease the key if implemented using priority queues. In simple words you need ‘V’ time to relax the edges. Therefore the answer will be O(V^3). 0 votes 0 votes Please log in or register to add a comment.