Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 B[j] j++; i++; } return j; } 5. 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 n) { int i, j; for (i=0; i<><>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago