EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
热门代写
您的位置: 主页 > 写作技巧 > 热门代写 >
computer programs代写,Java代写
发布时间:2021-03-06 20:21:50浏览次数:
10 Sep’19: Add clarification on the requirement to use red-black tree for Part B Q2c, in particular for this question, your algorithm must:
–Only use red-black tree datastructure
–Assume that the maximum time index is a variable (i.e., the complexity requirement should still hold if the maximum time index is a variable k, which is given as input, rather than145)
computer programs代写,Java代写

In the implementation of the algorithm (Part B Q2d), the implementation must follow the algorithm you have written in Part B Q2c. You are only allowed to use other data structure to output the sorted list of session IDs
—that is, the second line of the output.
9 Sep’19: Clarifications in blue text, which consists of:
–Part A, Q1, clarify what k
–Part A, Q2, clarifications of x and y and the input to the function, as well as n as the number of nodes in the tree T.
–Part B, Q2b, n is the number of nodes in the red-black tree that are already in the tree when a node is inserted.
–Part B, Q2c, n refers to the number of lecture sessions.computer programs代写
–Part B, Program input: The session ID is sorted.
–You can add functionalities in the code we provided with this assignment.
–29 Aug’19: The ancestor of a node x includes the node x itself.
–29Aug’19: Please set the output of your program (for Part B Q2d) to be sorted in ascending
[40 points] Part A.computer programs代写
[10points] Mr Bug is known for developing software that are  The latest software he delivers to Mr Fix’s company is supposed to sort an array of n numbers in ascending order. However, upon using the software, Mr Fix notices that the software does not sort the numbers exactly correct: It always places the numbers within k slots of its proper position.
This means, suppose the correct position of a number x in the sorted array is at indexi, then in the output of Mr Bug s/w, the number x can be placed in any index between [max(0, i k), min(i+k, n)]. Since Mr Bug is no longer reachable, Mr Fix decided to take the output of Mr Bug software and sort them correctly. Since the data can be any type of data, Mr Fix would like to use comparison-based sorting to sort the output of Mr Bug’s software. Mr Fix thinks for these “pre-sorted” numbers, the comparison-based sorting procedure takes Ω(n log k) number of comparisons, rather than Ω(n log n), where k ≤ n . Is he correct? Please provide the proof to support or refute Mr Fix argument.computer programs代写
[20points] Let T be a full binary search tree of height h.
And, let A(x) of a leaf node x in T be the ancestor set of x (i.e., it is the union of x’s parent, grandparent, all the way to the  Here, we follow a common convention in algorithms that duplicates in union set of tree nodes is checked based on the key and that the ancestor of a node includes the node itself. Suppose f (x, y) = a∈A(x)∪A(y) a.key. Please:
(a)[10 points] Design an algorithm that can compute f (x, y) in O(n log n) time, where n is the number of nodes in T.
(b)[10 points] Derive the time complexity of the algorithm you designed in 2a.
Note that when one implements a function that takes x and y as inputs, these inputs become input argument to the implemented function. To simplify the problem, you can assume each node has a unique key. Of course, if your algorithm can handle non-unique key, it should be fine too.computer programs代写
3.[10 points] Every student enrolled at UNA is given a locker to store their books.
The locker has a lock mechanism akin to a luggage lock with 3-digit password lock (Fig.  1 shows an illustration).   Suppose the password each lock is set uniformly   at random and independently from the other locks by the locker administrator, and suppose this password cannot be changed. The administrator will improve this lock mechanism once the number of enrolled students at UNA is large enough that there’s more than 50% chance that two UNA students have the same password lock. How many enrolled students should UNA has before the administrator improve the lock mechanism? Please explain your answer.
Figure 1: An illustration of the luggage lock for UNA’s students’ lockers.
[60 points] Part B.
Finding a parking spot during semester time is a big problem at UNA, and Mr ParkingPls is determined to address this problem. To this end, he observes that the difficulty in finding a parking spot is worst on a certain day of the week and a certain time on that day. He hypothesises that the main culprit of the worst parking problem is that there is an extremely large number of overlapping lecture sessions on that particular day and time. If this is true, he can recommend that UNA either redistribute the lecture slots more evenly during the week or rent a nearby land on the particular day and time each week to expand its parking capacity.
Of course first,  Mr ParkingPls must test his hypothesis.computer programs代写
To  this end,  he has obtained the schedule of all lectures  at UNA. Since all classes at UNA either starts or ends at the beginning of an hour or half an hour, Mr ParkingPls simplifies the lecture sessions representation by creating a time index for every half-hour between 06:00 and 20:00 (inclusive) within a week —that is, time-1 refers to Monday 06:00, time-2 refers to Monday 06:30, , time-145 refers to Friday 20:00—. He then represents each lecture session as a half-open interval of time index, e.g., interval [3, 5) means the lecture starts on Monday 07:00 end ends (at a negligible amount) before Monday 08:00. The question is now to find the time index with the most number of overlapping lecture sessions. Now, since he has only limited knowledge about Algorithms, he asks your help.