Question: . (3 marks) (5 marks) 1. (a) Give pseudocode for an algorithm that runs in O(2) time. (b) Give pseudocode for an algorithm that

. (3 marks) (5 marks) 1. (a) Give pseudocode for an algorithm that runs in O(2) time. (b) Give pseudocode for an algorithm that runs in O(n log n) time. (c) Do the following algorithms run in O(n) time? Provide a brief explanation for each algorithm. (1) S=0; for(i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
