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

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

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

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

EG1hao
网课代修代上,cs代写代考
C语言代做
您的位置: 主页 > 编程案例 > C语言代做 >
代做C语言:Design and Analysis of Algorithms代写 programming assignment代写 - C语言代做
发布时间:2021-07-25 20:26:19浏览次数:
Design and Analysis of Algorithms 2019Design and Analysis of Algorithms代写 For this programming assignment, you will not have to submit any written answers. Instead, youwill submitNational University of Singapore CS3230Programming Assignment (Due Date: 7 Mar 2019)For this programming assignment, you will not have to submit any written answers. Instead, you will submit all of them on CodeCrunch at https://codecrunch.comp.nus.edu.sg/. You will have to submit in Java or C++11 and the portal will stop accepting submissions after 7 Mar 2019 2359h so please start your assignment early.Design and Analysis of Algorithms代写To  get the full score for each part,  you need to pass ALL the test cases correctly and within    the time limit. The time limit for each test case is different for each part and will be stated below. As this is a programming assignment, not only is the time complexity of your algorithm important, but also the efficiency of your implementation.If you are able to solve more than half the test cases correctly but not all, your algorithm is most likely correct but too slow, so think about how to make the implementation more efficient. We may award partial marks to you after the assignment if your answer is very close to the correct answer. You are strongly encouraged to create your own test cases for your own testing.Templates will be provided for all the problems. These templates provide a starting point for your implementation and also provide fast implementations of the input routine. You are strongly recommended to use all the templates given to you. Do not change the file name or the class name of the template, or else your code will be marked as incorrect. However, you have to submit your own work. Any form of plagiarism is subject to disciplinary action.Design and Analysis of Algorithms代写Background Design and Analysis of Algorithms代写Mr. Panda has started a new delivery company called Amazin which helps customers deliver pack- ages across very long distances. The company houses all its packages inside a warehouse where they are arranged neatly so that they can be located for delivery later.As the company grows, the number of packages it needs to manage in its warehouse has increased significantly and the human workers simply cannot keep up with the workload. Thus, the company has resorted to using automated robots to help them perform tasks around the warehouse.Design and Analysis of Algorithms代写There are many different tasks to be done around the warehouse and efficiency is of utmost impor- tance in order to ensure the packages get delivered on time. Thus, Mr. Panda has hired you, his best programmer, to design and program the most efficient algorithms into the robots to perform several tasks around the warehouse.Task A (3%) Design and Analysis of Algorithms代写The warehouse contains N charging points labelled 1 to N . These charging points can charge the robots almost instantly. Using this charging points as vertices, the warehouse can be modelled as an undirected, weighted graph with E edges between the charging points with weight equal to the amount of time taken to travel between them. Some pairs of charging points have no edge because of obstacles such as walls between them.The storage unit is at charging point 1 and delivery unit is at charging point N .  You  need to find a route for the robots to follow to transfer packages from storage to delivery. When following the route, the battery of the robot must be able to last at least as long as the highest weight edge along the path, since that is the maximum amount of time it has to travel without charging.Design and Analysis of Algorithms代写You know you want the route to take at most T time units in total and charging time is negli- gible, however you do not need to choose the shortest path. Instead, you want to save costs by minimising how long the battery needs to last, since longer-lasting batteries are more expensive. Design an algorithm and write a program to calculate this minimum value.InputThe first line of input will contain 3 integers, N , E and T as described above. The next E lines of input will each contain 3 integers, u, v and w representing an edge between vertices u and v with weight w. The edges in the input will be sorted in non-decreasing weight and the shortest path from 1 to N will be at most T time units.OutputYour program simply needs to output one integer on a single line representing how long the battery needs to last in order to deliver the packages within T seconds.Example InputDesign and Analysis of Algorithms代写Example Output7ExplanationIn this example, we have a graph with 5 vertices and 7 edges. We want to find the minimum battery needed to deliver packages within 13 time units. There are 3 possible routes. The route 1, 4, 5, 6 Design and Analysis of Algorithms代写is not feasible since the total length if 14 which is more than 13. This leaves 1, 3, 5, 6 and 1, 2,  5, 6, both of which have total length at most 13. The maximum edge along the routes are 7 and 8 respectively, of which the lowest value is 7 which is the answer.Limits2≤ N ≤ 216, 1 ≤ E ≤ 217, 1 ≤ u  v ≤ N, 1 ≤ w, T ≤ 109Your algorithm should have a time complexity of O(E log E) and solve each test case within 3.0 seconds for Java and 1.0 seconds for C++.You should modify the template javaand submit that file to CodeCrunchTask B (4%)In order to easily locate packages for delivery, the packages need to be sorted in some way. An overseas shipment of N packages have arrived that you need to distribute within your country.To make it easier to locate the packages, you plan to use the robots to sort the packages in non- decreasing order of weight. However, as the robots are small, they are only able to swap 2 neigh- bouring packages. Furthermore, the robots are also light so if the 2 packages it swaps differ in weight by more than D grams, the robot will become imbalanced and may tip over.Design and Analysis of Algorithms代写Given this, you want to estimate the risk that the robot will tip over by calculating the minimum number of swaps needed where the boxes differ in weight by more than D grams.InputThe first line of input will contain 2 integers, N and D as described above. The next line of input will contain N integers, representing the weight of the boxes in grams from left to right.OutputYour program simply needs to output one integer on a single line representing the minimum num- ber of swaps needed where the boxes differ in weight by more than D grams.Example Input Design and Analysis of Algorithms代写4 23 4 3 1Example Output1ExplanationThere are 4 boxes with weights in the order (3,4,3,1) and we want to count swaps with weight difference more than 2. We swap the middle 2 boxes first with weight difference 1 giving (3,3,4,1). Then we swap the last box to the start, with weights (4,1), then (3,1) and (3,1) thus resulting in the order (1,3,3,4). Only the swap (4,1) has difference of more than 2 so the answer is 1.LimitsThere are 2 parts to this assignment Design and Analysis of Algorithms代写Part 1 (2%) Design and Analysis of Algorithms代写1≤ N ≤ 216, 1 ≤ D, box weights ≤ 109Your algorithm should have a time complexity of O(N log2 within 0.5 seconds for Java and 0.33 seconds for C++.Part 2 (2%)1≤ N ≤ 220, 1 ≤ D, box weights ≤ 109Your algorithm should have a time complexity of O(N log N ) and solve each test case within 0.5 seconds for Java and 0.33 seconds for C++.HintsYou ask Mr. Panda for some hints on this task. He tells you that counting the number of swaps, re- gardless of their weight difference, is equivalent to counting the number of inversions. He asks you to look at the article https://www.geeksforgeeks.org/counting-inversions/ and an efficient Java implementation of that algorithm called CountingSwaps.java. You  are strongly encouraged to understand and modify the code to implement your algorithm to solve this task. Mr. Panda also tells you that to solve Part 1, you only need to change/add at most 10 lines of code from the implementation given. To solve Part 2, you only need to change/add at most 5 lines of code from the implementation given.Design and Analysis of Algorithms代写Challenge Task (1%, optional)Instead of sorting the packages by weight, you realise that the packages also have a unique ID from 1 to N and sorting by ID instead will make locating the packages much easier. Thus, you plan to use the robots to sort these packages in increasing ID instead of by weight.Design and Analysis of Algorithms代写The robots have the same constraints as described in the previous task and you want to also want to calculate, in this case, the minimum number of swaps needed where the boxes differ in weight by more than D grams.InputThe first line of input will contain 2 integers, N and D as described above. The next line of input will contain N integers, representing the weight of the boxes in grams from left to right. The next line of input will contain N integers, IDs of the boxes from left to right. The IDs will form a permutation of the integers from 1 to N .Output Design and Analysis of Algorithms代写Your program simply needs to output one integer on a single line representing the minimum num- ber of swaps needed where the boxes differ in weight by more than D grams.Example Input4 14 2 4 22 4 3 1Example Output3Limits1≤ N ≤ 216, 1 ≤ D, box weights ≤ 109Your algorithm should have a time complexity of O(N log2 N ) and solve each test casewithin 4.0 seconds for Java and 0.33 seconds for C++.You should modify the template CountingSwaps.java to and submit that file to Code- CrunchDesign and Analysis of Algorithms代写其他代写:function代写 web代写 编程代写 数学代写 algorithm代写 python代写 java代写 project代写 dataset代写 analysis代写 C++代写 代写CS 金融经济统计代写 essay代写 assembly代写 program代写 code代写 CS代写 finance代写 Data Analysis代写合作平台:315代写 315代写 写手招聘 Essay代写

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。