How many element comparisons are performed by the algorithm


Problem: Parallel Algorithms

I) Let Array A [1: 60] = 51, 52, ...., 109, 110. How many element comparisons are performed by Algorithm BINARYSEARCH when searching for the following values of x?

(i) 20 (ii) 57 (iii) 150

II) (i) Illustrate the operation of Algorithm SELECTIONSORT on the following array, showing the contents of the array after each outer-most iteration.

9
14
11
3
4
7

(ii) How many element comparisons are performed by the algorithm?

III) (i) Illustrate the operation of Algorithm INSERTIONSORT on the following array, showing the contents of the array after each outer-most iteration.

9
14
11
3
4
7

(ii) How many element comparisons are performed by the algorithm?

IV) (i) Illustrate the operation of Algorithm BOTTOMUPSORT on the following array, showing the contents of the array after each outer-most iteration.

9
14
11
3
4
7

(ii) How many element comparisons are performed by the algorithm?

V) In your own words (not more than 50 words), explain how do the below algorithm sorts an array of n elements.

i. the SELECTIONSORT
ii. the BOTTOMUPSORT
iii. the INSERTIONSORT.

The response must include a reference list. Using Times New Roman 12 pnt font, double-space, one-inch margins, and APA style of writing and citations.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: How many element comparisons are performed by the algorithm
Reference No:- TGS03133849

Now Priced at $35 (50% Discount)

Recommended (97%)

Rated (4.9/5)