Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( a ) We wrote Open that polling place j . You might legitimately worry that the algorithm is underspecified if there are multiple polling

(a) We wrote Open that polling place j. You might legitimately worry that the algorithm is underspecified
if there are multiple polling places j, j
that each reach n/k voters at exactly the same time t. Explain why
this is not a concern here.
(b) As we said above, the description about continuously increasing t and looking what happens is not programming friendly. Here, you are to describe how to implement this algorithm to run in time O(n
2
log n).
(See below for the case when you find that difficult.) In doing so, you will almost certainly want to draw on
multiple algorithms and data structures you learned in CSCI 104, as well as some mathematical knowledge
about logs and other functions.
You should not give actual code here rather, give pseudo-code which a competent CSCI 104 student
could easily turn into actual Python/C++ code. Also, if you use algorithms or data structures from CSCI
104(or CSCI 170), you do not need to actually give the code simply say which algorithm or operation
you are calling (such as Run BFS from node v and store the distances in an array x.).
(c) Explain informally why your detailed algorithm returns the same result as our informal continuous-time
algorithm.
(d) Carefully analyze the running time and show that it is O(n
2
log n).(Note that we are only asking for the
upper bound of O(n
2
log n) here, not a lower bound of (n
2
log n) though the latter would be easy to
prove.) For any algorithms or data structures you learned in CSCI 104, you can simply state the running
times that you were taught and use in your analysis no need to reprove them yourself.
If there are some parts that you cannot get to run in O(n
2
log n), explain which those parts are, what obstacles
you were facing, and what you would need to make it work. The more parts you can get in O(n
2
log n), the
closer to full credit you will be. If your algorithm runs in O(n
3
), you will get partial credit, depending on how
many key parts are faster.

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions

Question

How do you add two harmonic motions having different frequencies?

Answered: 1 week ago

Question

2. Define communication.

Answered: 1 week ago