Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9A: Plotting Run Time for Binary Search Write a method which uses binary search algorithm to check if a value is in an array or

image text in transcribed
9A: Plotting Run Time for Binary Search Write a method which uses binary search algorithm to check if a value is in an array or not. Return true if in the array, false if not. Also write a test program to record the time it takes to search arrays with different size (test to find optimal size for plotting). More specifically, in main method, create arrays in different size and initialize the array with random numbers, then call the method to search in each of those arrays. Output the time it takes for searching each array Once you got the time along with the size of the array, copy them to an Excel worksheet, plot a graph to show the time complexity. Letx-axis be the size and y-axis be the time. If the size and time unit are chosen appropriately, you should be able to get a graph in log n shape. Submission 1. The java program (if it's multiple files, zip them) 2. The excel worksheet with graph

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions