Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please don\'t use handwriting in answers, because I cannot understand it. The an

ID: 3826094 • Letter: P

Question

Please don't use handwriting in answers, because I cannot understand it.

The answer related with java

Calculate the Big Oh performance for the Sequential Search on the array given below that has 15 elements? Given that sequential search of an array of 10 elements took on average 1 second. [99, 101, 8, -22, 3, 55, 42, -1, 0, 52, 33, -4, 66, 1, 52] Calculate the Big Oh performance for the Binary Search on the sorted array given below that has 15 elements? Given that Binary search of an array of 10 elements took on average 1 second. [-22, -4, -1, 0, 1, 3, 8, 22, 42, 52, 52, 55, 66, 99, 101]

Explanation / Answer

A) Big oh performance for the sequential search on n elements is O(n) time.

     for 10 elements - O(10)

     for 15 elements - O(15)

     for 10 elements, if it take on average 1 second (1000 milli seconds) then

     for 15 elements, it may take on average 1.5sec(1500 msec).

B)

    Big oh performance for the Binary search on the sorted array will take O(log n) for n elements.

    for 10 elements it will take O(log 10) that is 3.32

    for 15 elements it will take O(log 15) that is 3.90

   Note that, all log values are base 2 only