亚洲十八**毛片_亚洲综合影院_五月天精品一区二区三区_久久久噜噜噜久久中文字幕色伊伊 _欧美岛国在线观看_久久国产精品毛片_欧美va在线观看_成人黄网大全在线观看_日韩精品一区二区三区中文_亚洲一二三四区不卡

COMP2013代做、代寫Data Structures and Algorithms
COMP2013代做、代寫Data Structures and Algorithms

時間:2024-04-24  來源:  作者: 我要糾錯



COMP2013 Data Structures and Algorithms
Programming Assignment 2 Deadline: 10:00am, 22th April, 2024
Instructions
 Submit the soft-copy of your program to Learn@PolyU
 You can only submit one program file (either C++ or Java or Python),
and the filename must follow the format below.
Language Filename format Filename example
C++ mainStudentID.cpp main10987654d.cpp
Java mainStudentID.java main10987654d.java
Python mainStudentID.py main10987654d.py
- We only accept file types in .cpp, .java, .py. We do not accept file types like .ipynb, .h, etc.
Section 1. Problem
You have n pipes with lengths in meters. You need to connect all these pipes into one pipe. You can
connect two pipes into one at a time. For two pipes with length i and j meters respectively, the cost to
connect them is 𝑡𝑡(𝑖𝑖,𝑗𝑗) = 𝑚𝑚𝑚𝑚𝑚𝑚(𝑖𝑖,𝑗𝑗) + 3; the connected pipe has length i+j meters.
The task is to minimize the total cost to connect all n pipes into one pipe, where the total cost is the sum
of all connection costs.
Example: you have 4 pipes in length 6, 5, 2, 8. After connecting all pipes, you will get one pipe with
length 21 meters. Your task is to minimize the total cost to connect these pipes into one. There can be
different ways to perform the connections. Given 4 pipes, there are  
4
2  ×  
3
2  = 18 ways to perform the
connections, and below shows one possible way (not with optimal cost),
- Connect pipes with length 6,5 first, with cost 9, and result in three pipes with length 11,2,8
- Then connect pipes with length 11, 2, with cost 14, and result in two pipes with length 13, 8
- Then connect pipes with length 13, 8, with cost 16, and result in one pipe with length 21.
- The total cost of the connections above is 9+14+16=39.
For this example, an optimal way to connect pipes should have minimum cost 34.
Given n pipes, implement a greedy algorithm that can correctly obtain the minimum total cost to connect
them into one pipe, adhering to the requirements above. Your program should have time complexity
O(nlogn). (You do not need to prove the optimality of your greedy algorithm.)
Section 2. input and output of your format
In the table below, it shows a sample of the input file and the output of your program. Your program
should take as input a filename (e.g., file1.txt), and then read the integers (one integer per line) in the file.
These integers are the length of pipes. The number of non-empty lines in the file is the number of pipes
you need to handle.
Your program will output an integer value to the screen, which is the minimum cost obtained by your
program.
Sample input file “file1.txt” The output on screen (stdout)
6 34
5
2
8
We will run your program by a command line like:
where the argument “file1.txt” is an example of the input filename.
Your program should only output the result number.
Please follow the above output format and DO NOT print any extra information.
Notes:
- We will use 10 test cases to grade your program
- The pipe length is positive integer in range [1, 1000]
- In a test case, the number of pipes is at most 10000.
Implementation Instructions:
In your implementation, you can use existing libraries that support data structures like list, stack, queue,
min-heap, max-heap, priority-queue, etc. (In other words, you do not need to implement these
fundamental data structures)
You are allowed to use operator or standard library function (e.g., in C++, Java, Python) to perform
lexicographic comparison for string. Examples:
• C++: https://cplusplus.com/reference/string/string/compare/
• Java: https://docs.oracle.com/javase/tutorial/java/data/comparestrings.html
• Python: https://docs.python.org/3/library/stdtypes.html#comparisons
Section 3: Grading Criteria
Naming conventions, compilation and execution commands
 Before submission, rename your program to
 mainStudentID.cpp, e.g., main10987654d.cpp
 OR mainStudentID.java, e.g., main10987654d.java
 OR mainStudentID.py, e.g., main10987654d.py
 [C++ and Java only] Make sure that you can compile your program using the command:
 g++ mainStudentID.cpp -o mainStudentID
 OR javac mainStudentID.java
o No marks will be given if your program cannot be compiled.
Language Command line
C++ (after compilation) ./mainStudentID file1.txt
Java (after compilation) java mainStudentID file1.txt
Python python mainStudentID.py file1.txt
 We will run your program by a command line like:
 ./mainStudentID file1.txt
 OR java mainStudentID file1.txt
OR python mainStudentID.py file1.txt
where the argument “file1.txt” is an example of the input filename.
Make sure that you can execute the above commands on the COMP apollo server successfully.
Otherwise, no marks will be given. The current versions on apollo are as follows:
g++ (GCC) 4.8.5, javac 1.8.0_20, Python 2.7.5
Test files for grading
Total marks: 100 marks
Your program will be graded by using 10 test files.
For each test case, if your program can return the correct output within 1 minute, it is a successful case
and you get 10 marks. Otherwise, this is a failed case with 0 marks.
- The running time of your program will be measured on the COMP apollo server.
If your program is not a greedy approach, extra 50 marks will be deducted from the total marks you
get from the 10 test cases above. Final grade of the assignment is in the range [0,100].
Appendix
(1) How to activate your COMP account?
Please click the following link to activate your COMP account:
https://acct.comp.polyu.edu.hk/
according to the instructions in:
https://acct.comp.polyu.edu.hk/files/COMPStudentAccountSelfActivation.pdf
(2) How to login the COMP apollo server?
[Step 1]
Use PuTTY (or any SSH client
program)
Enter the host name
csdoor.comp.polyu.edu.hk
Click the “Open” button.
If you see the message “The host
key is not cached for this
server…”,
just accept to continue.
[Step 2]
Enter your COMP account
username and password.
Note that, when you are entering
the password, it is not displayed
in PuTTY.
[Step 3]
Enter the hostname apollo
Then enter your COMP account
password (the same as in Step 2).
[Step 4]
Use WinSCP (or any SFTP client program).
Enter the host name csdoor.comp.polyu.edu.hk
Enter your COMP account username and password.
Upload your program to the server.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp









 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代寫DTS101TC、代做Python設計編程
  • 下一篇:CS 161代做、Java/Python程序代寫
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    伊人久久综合| 精品中文字幕一区二区三区四区| 国产伦精品一区二区三区视频青涩| 黄色网页在线播放| www视频在线免费观看 | 亚洲一区二区电影| 亚洲澳门在线| 久久国产精品99国产| 国产一区二区三区精品在线观看 | 日本午夜视频| 欧美三级电影精品| 亚洲高清视频中文字幕| 爽爽窝窝午夜精品一区二区| aaa日本高清在线播放免费观看| 大片免费在线看视频| 亚洲妇女成熟| 伊人色综合久久| 精品久久久久久综合日本欧美| 在线亚洲人成电影网站色www| 国产精品一区二区三区av | 精品国产乱码久久久久久图片 | 中文字幕一区二区三区不卡| 欧美精品一卡二卡| 91福利在线播放| 亚洲伦理在线精品| 亚洲国产精品高清| 精品久久久久久亚洲精品| 懂色aⅴ精品一区二区三区蜜月| 亚洲一区二区精品视频| 久久人人爽人人爽| 国产suv精品一区二区883| 一区二区三区四区中文字幕| 成人三级黄色免费网站| 视频二区在线| 性色av一区| 韩国精品主播一区二区在线观看 | 久久动漫亚洲| 666欧美在线视频| 成人免费网站观看| 免费成人美女在线观看| 日本电影亚洲天堂一区| 黄色免费网站在线| 精品亚洲精品| 丝袜美腿亚洲一区二区图片| 91成人网在线观看| 国产精品一国产精品k频道56| 日本成人a网站| 99久久影视| caoporn成人| 成人中文字幕视频| 国产亚洲字幕| 国产成人综合在线| 日本一区二区三区高清不卡| 国产日韩欧美不卡| 欧美性猛交xxxx乱大交蜜桃| 欧美成人明星100排名| 中文字幕在线观看一区二区| 精品国产伦一区二区三区观看体验 | 亚洲成av人片在线| 国产精品高颜值在线观看| 综合精品久久久| 欧美美乳在线| 一本一本久久| 久久婷婷久久一区二区三区| 欧美精品 国产精品| 欧美电影影音先锋| 国产经典一区| 亚洲无线一线二线三线区别av| 久久亚洲精品国产精品紫薇| 一本色道久久综合亚洲aⅴ蜜桃| 色综合天天综合在线视频| 天天噜夜夜操| 欧美在线资源| 精品国产污污免费网站入口 | 免费看成一片| 午夜激情影院| 日韩视频在线一区二区三区| 久久福利资源站| 成人a视频在线| 久热精品视频| 欧美偷拍视频| 91久色porny| av资源一区| 成人网在线免费视频| 日本成人一区二区三区| 天堂99x99es久久精品免费| 久久综合色播五月| 一本大道综合伊人精品热热| 日韩美女在线| 国产精品伊人色| 精品日韩欧美一区二区| 色偷偷色偷偷色偷偷在线视频| 成人免费在线观看av| 久久先锋影音av鲁色资源| 日韩一二三区视频| 亚洲经典在线| 在线成人私人影院| 国产激情综合| 亚洲欧美综合另类在线卡通| а√中文在线8| 国产伦理精品不卡| 国产99久久久精品| 激情校园亚洲图片| 欧美三级一区| 亚洲少妇30p| 一个人看的www视频在线免费观看 一个人www视频在线免费观看 | 欧美日精品一区视频| 日韩成人影音| 99国产精品久| 污污网址在线观看| 日韩精品免费观看视频| 激情亚洲成人| 欧美色xxxx| 日本大胆在线观看| 欧美视频在线观看| 大伊人狠狠躁夜夜躁av一区| 日本伊人久久| 91麻豆精品国产91久久久久久久久 | 精品伊人久久久| 日韩一区二区三区观看| 成人3d精品动漫精品一二三| 91精品国产乱| 国产精品日韩精品在线播放| 国产精品美女久久久久久久| 亚洲狼人在线| 91官网在线免费观看| 天天做天天爱天天综合网| 欧美性猛交xxxx久久久| av天在线观看| 欧美成人高清| 欧美一区二区三区四区在线观看| 激情小说亚洲| 亚洲欧洲成人精品av97| 天天色天天射天天综合网| 成人激情文学综合网| 久久久男人天堂| 日韩美女视频一区| 国产亚洲成av人片在线观看| 国产在线不卡一卡二卡三卡四卡| 日韩一区二区三区四区五区 | 97香蕉久久| 国产精品地址| av毛片免费| 精品999成人| eeuss在线观看| 久久成人亚洲| 精品电影在线| 国内精品自线一区二区三区视频| yiren22综合网成人| 懂色av一区二区三区蜜臀 | 污片视频在线免费观看| 成人精品视频一区| 91在线超碰| 亚洲丝袜精品丝袜在线| 秋霞影院一区| 欧美精品三级在线观看| 亚洲激情中文| 在线伊人免费视频| 国产麻豆一精品一av一免费| 婷婷五月在线视频| 国产日产欧美一区二区视频| 国产探花视频在线观看| 国产精品福利影院| 亚洲视频国产| 日韩一级完整毛片| 韩日在线一区| 成人精品一区二区三区免费| 久久综合久久综合九色| 亚洲精品大全| 欧美一区二区三区婷婷月色 | www.精品| 色综合中文字幕| 天天天综合网| 黄色av网址在线免费观看| www国产成人| 一区二区三区在线资源| 欧美大片顶级少妇| 另类调教123区| 亚洲精品**中文毛片| 亚洲国产综合视频在线观看| 精品国产91乱码一区二区三区四区| 天天插天天狠天天透| 成人97人人超碰人人99| 未满十八勿进黄网站一区不卡| 欧美高清性hdvideosex| 日精品一区二区三区| 在线视频超级| 欧美美女一区二区在线观看| 日韩中文字幕亚洲一区二区va在线| 欧美极品少妇videossex| 亚洲自拍与偷拍| 欧美三级网页| 亚洲欧美成人影院| 日本丶国产丶欧美色综合| 国产午夜久久| 中文不卡1区2区3区| 欧美精品少妇一区二区三区 | 日本欧洲一区| 中文在线资源观看网站视频免费不卡 | 91国偷自产一区二区使用方法|