算法代写 | Algorithms and Complexity (Extended)

本次英国代写是图灵机 – 算法与复杂性相关的限时测试

Algorithms and Complexity (Extended)

Exam paper

This exam is out of 70 marks. You can use any results (theorems, algorithms, etc.)
covered in the module (lectures and assignments).

Question 1

Recall that we write L for the class of languages decidable by a deterministic Turing
machine using O(log n) space. Show that the language R of words in f0; 1g
with twice as many 0s as 1s is in L.

For instance, 010; 001; 010010 2 R , but 011; 010110 = 2 R. You may assume that
basic arithmetic operations on binary integers, e.g. +1 and checking for equality, are
e ectable using only a constant amount of additional space.

Question 2

Consider a set of 5 hospitals and 5 students. Can the Gale-Shapley algorithm (where
hospitals make o ers to students) ever match a hospital h to a student s such that s is
last on the preference list of h? Either prove that this cannot ever happen, or design a
set of preference lists for hospitals and students for which this occurs.

Question 3

You want to spend n days in a new city. The two possible hotels are Hilton and Ritz. For
each 1  i  n, the cost of staying at the Hilton on day i is Hi and the cost of staying
at the Ritz on day i is Ri where Hi ;Ri are some positive constants. The cost of moving
from one hotel to the another is 100. You can start your stay at any of the two hotels.
Design an O(n) time algorithm which calculates the least possible expenditure of an n-day
stay. Explain both the correctness and running time of your algorithm.


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: itcsdx@outlook.com  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论