Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I am studying data structures and algorithms and I am not sure how to solve this problem? Can anyone please show me how to

Hello, I am studying data structures and algorithms and I am not sure how to solve this problem? Can anyone please show me how to solve step by step? If you dont know the answer PLEASE do not answer and waste my question.

image text in transcribed

You are a programmer for the Committee to Abolish CS 32, which wants to conduct a voter registration drive in West Los Angeles and the Valley. You have a collection ofregistered voters in those areas, and you have obtained a collection oflicensed drivers from there. You want to find all drivers who are not already registered to vote. Both the driver and voter collections are randomly ordered Here are two algorithms you are considering: 1) for each licensed driver found false for each voter. if the driver under consideration the current voter found true break if not found print the driver's name 2) sort the collection of voters by name, using a good algorithm sort the collection of drivers by name, using a good algorithm start with the first voter and the first driver while not done with the voter collection and not done with the driver collection, if the current driver's name is alphabetically k the current voter's name, print the driver's name go on to the next driver else if the driver's name the voter's name go on to the next driver go on to the next voter else the driver the voter go on to the next voter print the remaining names, if any, in the driver collection a. [5 points] Suppose the driver collection and the voter collection each contain about N names, where N is large. Of the following choices, what is the average case time complexity of the two algorithms? The choices are O(1), O(logN), O(N), O(N log N), O(N2), O log N), O(N). Answer: Algorithm 1 Algorithm 2 b. [5 points] Using a particular computer, you run an algorithm with time complexity o and find that it takes a little under 2h hours to run using the West LA and Valley data. Suppose you wish to run that algorithm for all of California, which has 10 times as many voters and drivers as West LA and the Valley. (California has about 20 million drivers.) About how long would that algorithm take on the California data, using the same computer

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago

Question

=+Is it possible to operate union-free?

Answered: 1 week ago

Question

=+impact member states and MNEs?

Answered: 1 week ago