Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

* Home Co CSC 5 CSCI120D (Fall 2018) - Introduction to Computer Science and ProgrammingI (Python) Lab 9D Investigating the efficiency of the Binary Search

image text in transcribed

* Home Co CSC 5 CSCI120D (Fall 2018) - Introduction to Computer Science and ProgrammingI (Python) Lab 9D Investigating the efficiency of the Binary Search algorithmm Lab 9D Investigating the efficiency of the Binary Search algorithm Return to: 5 November - 11... Using your solution to Lab 9C, write a program that counts how many steps to find the number 9467 in a list of size 20000 (using unique random numbers in the range 1 through 321000). Then double the list size to 40000 and count the steps taken to find the same number, then keep doubling the list size until the list size is 320000. For each list size, find how many steps to find the number 9467. Your program should print the list size followed by the number of steps, for each list size... NOTE: it may take several minutes for the program to complete its output. Be patient! The output should look similar to this: Length ot list: 209 Steps: 14 NOT Fuund lenath of list: 4 steps: 15 NCT Found! Length ot list: 8 Steps: 16 NCT Found I length of list: 16888 steps: 17 NOT Found Length ot list: 32 Steps: 19 KCT Found

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