Answered step by step
Verified Expert Solution
Question
1 Approved Answer
LAB EXERCISES: (60 Minutes) 1. For an O(n?) algorithm, one data set with n = 3 takes 54 seconds. How long will it take for
LAB EXERCISES: (60 Minutes) 1. For an O(n?) algorithm, one data set with n = 3 takes 54 seconds. How long will it take for a data set with n= 5? 2. For an O(nk) algorithm, where k is a positive integer, an instance of size m takes 32 seconds to run. Suppose you run an instance of size 2m and find that it takes 512 seconds to run. What is the value of k? 3. Assume that an O(log2 n) algorithm runs for 10 milliseconds when the input size (n) is 32. What input size makes the algorithm run for 14 milliseconds? 4. Determine the running time for the following function in terms of the variable n (n>0). The answer should simply be in terms of Big-0. Justify your answer. int function(int A[], int B[], int n) { int i=0,j=0; while (i
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