[6 marks] (b) Show step by step how Dijkstra's algorithm would find the shortest distance between vertex A and vertex H
Posted: Wed Apr 27, 2022 3:32 pm
[6 marks] (b) Show step by step how Dijkstra's algorithm would find the shortest distance between vertex A and vertex H in the following weighted graph. H E F B (c) Define the following types of problems, and give an example of each: [6 marks] i) P problems NP problems iii) NP-complete problems [6 marks] (d) Write a Java method that computes modulus exponentiation, preferably in O(logn) time, without relying on any external imported libraries. The method takes a base b, an exponent n and a modulus m as input and returns b'modm. For example, given (2, 3, 7) as input, 1 would be returned as the answer, given that 20 mod 7 is 1.