Q2 calculate the big oh performance for the


Q1:(a)Write the java code for doing a Linear Search on the array given below.

Write your code in the space below, (no need to submit .java file)

(b) What would your search method return if we asked to search for the number 2 and return it's index position?

[24][2][45][20]56][75][2][56][99][53][12]

Q2 :Calculate the Big Oh performance for the following: Given that an Array of size n=10 takes 3 seconds to search, how long does it take a search Array of size n=100?
(a)Linear Search of an array of size n=100 Given O(n)
(b) Merge Sort performance of an array is O(nlog(n)),
given that an Array of size n=10 takes 3 seconds to sort, how long does it take to sort an Array of size n=100?

Solution Preview :

Prepared by a verified Expert
Chemistry: Q2 calculate the big oh performance for the
Reference No:- TGS01291714

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)