Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PART A Questions 1 and 2 of part A uses the following sorted array: table [ [ 9 , 1 1 , 1 4

PART A
Questions 1 and 2 of part A uses the following sorted array:
\table[[9,11,14,16,17,19,20,22,24,33,35]]
A.1.[2 marks] Suppose you are doing a sequential search on this sorted array; how many comparisons would you need to do in order to find the value 17?
In order to find the value of 17 we will nad to do 4 comparisons
A.2.[6 marks] Suppose you are doing a binary search; how many comparisons would you need to do in order to find each of the following values:
a)9
Answer: 8
b)22
Answer:
c)24
Answer:
A.3.[6 marks] Suppose you have the following array of numbers to sort. What are the partially sorted lists after 1,2 and 3 complete passes (iterations) of Insertion sort?
\table[[7],[15],[4],[6],[10],[5],[3],[16],[12],[11]]
image text in transcribed

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

=+34-1 Define cognition, and describe the functions of concepts.

Answered: 1 week ago

Question

assess the infl uence of national culture on the workplace

Answered: 1 week ago