Question: Following algorithm do and big o of function? What does the following algorithm do? Procedure WhatAmlDoing (a1, a2. an integers) x:= a1 for i:-2 to
Following algorithm do and big o of function?

What does the following algorithm do? Procedure WhatAmlDoing (a1, a2. an integers) x:= a1 for i:-2 to n if x>ai then x-ai return x O Finds the first positive integer in a list of integes , O Finds the first negative integer in a list of integers. O Finds the largest integer in a list of integers O Finds the smallest integer in a list of integers. Question 4 What is the big-O of the following function? fix) xA3+2 x*2 5(log x)A3 8 log x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
