Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(a) Why would we sort a dataset before we searched it? [2 marks] (b) You have a list of 100 sorted numbers and are looking
(a) Why would we sort a dataset before we searched it? [2 marks] (b) You have a list of 100 sorted numbers and are looking for a particular value. It takes a millisecond to compare each number to see if it's the one you want i. If we searching exhaustively across the list and the number we are looking for isn't there, how long will it take to work out that the number isn't there? You may assume that any operations other than comparison take up negligible time. [2 marks] ii. If we used binary search, how long would it take us, at most, to determine that the number wasn't there. You may assume that any operations other than comparison take up negligible time. [2 marks] (c) Provide the pseudocode algorithm for insertion sort using a single array. 4 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started