Answered step by step
Verified Expert Solution
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 nk 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 On
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 as well as some mathematical knowledge
about logs and other functions.
You should not give actual code here rather, give pseudocode which a competent CSCI student
could easily turn into actual PythonC code. Also, if you use algorithms or data structures from CSCI
or CSCI 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 continuoustime
algorithm.
d Carefully analyze the running time and show that it is On
log nNote that we are only asking for the
upper bound of On
log n here, not a lower bound of n
log n though the latter would be easy to
prove. For any algorithms or data structures you learned in CSCI 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 On
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 On
log n the
closer to full credit you will be If your algorithm runs in On
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
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