Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started