Home /
Expert Answers /
Computer Science /
3-answer-the-following-questions-using-the-pseudocode-below-i-what-does-this-algorithm-compute-pa310
(Solved):
3. Answer the following questions using the pseudocode below (i) What does this algorithm compute? ...
3. Answer the following questions using the pseudocode below (i) What does this algorithm compute? (ii) What is its Basic Operation? (iii) How many times is the Basic Operation executed? (iv) What is the efficiency class of this algorithm? (v) Suggest a way of making this algorithm better or indicate if it is not possible. ALGORITHM Secret \( (A[0 . \wedge-1]) \) /Tnput: An array \( A[0 . n-1] \) of \( n \) real numbers minval -A[0]: maxvoul \( \leftarrow A[0] \) for \( i \leftarrow 1 \) to \( n-1 \) do if \( A[i]\max v a l \) \( \operatorname{maxval} \leftarrow A[i] \) return maxval - minval
11. The time complexity of the following recursive implementation to find the factorial of a number is int fact(int \( n) \) \{ Your answer 2. Use the graph below to answer the following questions i. Perform DFS traversal on the graph ii. Perform BFS traversal on the graph iii. What is the adjacency matrix and adjacency list for the graph?