Q:

(Find u with smallest cost[u] efficiently) The getShortestPath method finds a u with the smallest cost[u] using a linear search, which takes O(V)

0

 (Find u with smallest cost[u] efficiently) The getShortestPath method finds a u with the smallest cost[u] using a linear search, which takes O(|V|).

 The search time can be reduced to O(log|V|) using an AVL tree. Modify the method using an AVL tree to store the vertices in V – T. Use Listing 29.7, TestShortestPath.java, to test your new implementation.

All Answers

total answers (0)

Similar questions


need a help?


find thousands of online teachers now