Question: please solve this 4. Given the following Algorithm where array is an array of size n sorted in ascending order and target is the search

please solve this
please solve this 4. Given the following Algorithm where "array" is an

4. Given the following Algorithm where "array" is an array of size n sorted in ascending order and "target" is the search key: What is the role of the function fn1 and what is its complexity time according to big O notation? 1. Fn1 is a binary search function with complexity =O(n) 2. Fn1 is a binary search function with complexity =O(log(n)) 3. Fn1 is a linear search function with complexity =O(n) 4. Fn1 is a linear search function with complexity =O(nlog(n)]) 5- Given the following Algorithm where Arr is an array of size n : Procedure p1(Arr, n ) For (1=0;1(3;i+t) Print "AuL" End for End Procedure What is the complexity time using big O notation? 1. 11n 2. O(12) 3. O(1) 4. O(n) 5. None of the above 6. Given the execution of the function getPermutations, what is its complexity time using big O notaion? getperautations(' a' )/1[ ' a] getpernutations('ab') If [ " ab+, " ba'] getpernutations('abc') //[ " "abc', "acb", "bac', "bca", "cab', 'cbo'] 1. O[n] 2. O(n2) 3. O(2) 4. O (nl) Page 3 of 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!