Question: 1. (a) Give pseudocode for an algorithm that runs in O(Vn) time. (6 marks) Hint: consider an algorithm whose input is an m m matrix.

1. (a) Give pseudocode for an algorithm that runs in O(Vn) time. (6 marks) Hint: consider an algorithm whose input is an m m matrix. So, the size n of the input is m* m and hence any O (m) algorithm is an O(Vn) algorithm. (b) Give pseudocode for an algorithm that runs in O(n * Vn) time. (7 marks) (c) Give pseudocode for an algorithm that runs in O(n2 vn) time. (7 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
