国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

COMP10002代寫、C/C++編程語言代做

時間:2024-05-22  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



The University of Melbourne
School of Computing and Information Systems
COMP10002 Foundations of Algorithms
Semester 1, 2024
Assignment 2
Due: 4pm Tuesday 21 May 2024
Version 1.0
1 Learning Outcomes
In this assignment you will demonstrate your understanding of structures, linked data structures, and algorithm
 time complexity analysis. You will further extend your skills in program design and implementation.
2 The Story...
In Assignment 1, we have extended your algorithmic searching capability to multidimensional numeric data.
In this assignment, we will continue to add text searching to your arsenal. We continue using point of interest
 (POI) search as the background application to minimise context switching. However, the algorithms
you will implement are generic to text search problems and serve as fundamental building blocks of search
engines such as Google or Bing. If you have missed Assignment 1, you can still compete this assignment –
it would be helpful to revisit the ffrst two pages of the Assignment 1 speciffcation to understand the context
in this case.
In Assignment 1, we have assumed that all POIs given are relevant to the queries (e.g., they are all cafes),
and we only need to fflter them based on the POI locations which are numeric properties. In reality, there
are POIs of many different categories in the same area, and only few are relevant to a query. See Figure 1
for example. There are not only cafes in the Melbourne CBD but also shops, supermarkets, hotels, post
offfces, a cathedral, etc. When a user queries for “cafes”, none of the POIs in the other categories need to
be considered. In this assignment, we will implement an algorithm to quickly fflter out POIs of irrelevant
categories (or web documents in search engines, users in social network searches, etc.).
Figure 1: POIs of different categories in Melbourne CBD
13 Your Task
The input POI and query dataset in this assignment is expanded to include POI category information. The
input still contains two sections, with a sample input shown below:
1. At least 1 and up to 50 lines of POI records. Each line represents a POI, which starts with an unique
integer POI ID of up to two digits (the POI IDs are just the line numbers, to simplify the assignment).
Each POI record then contains two real numbers representing the POI coordinates in the x- and ydimensions.
 After that, each POI record contains at least 1 and up to 5 category keywords (“category”
for short hereafter) separated by single whitespace characters. Each category is a string of at least
1 and up to 20 lower-case English letters. At the end of each line, there is a special character ‘#’ to
indicate the end of the line – this is used to simplify input processing for the assignment; it is not part
of the POI categories.
You may assume that there are no repetitions among the categories of a POI. In the sample input
below, POI #0 has coordinates (16.4, 69.4), and its categories are petrol, atm, and carwash.
2. At least 1 and no predeffned maximum number of lines of queries. Each line represents a query, which
starts with four real numbers representing the query range (xlb, ylb, xub, yub) as in Assignment 1. Recall
that xlb and ylb represent the lower bounds in the x- and y-dimensions of the query range, while xub
and yub represent the respective upper bounds. Intuitively, each query range is a rectangle whose
bottom left corner is at (xlb, ylb) and top right corner is at (xub, yub). You may assume that xlb < xub
and ylb < yub always hold. Each query line is then followed by a query category, which is a string of
at least 1 and up to 20 lower-case English letters.
All coordinate values are in (0, 100). Note that there is a line with 10 ‘#’s to separate the two input sections.
0 16.4 69.4 petrol atm carwash #
1 88.7 13.3 atm #
2 19.5 78.5 shop supermarket atm coles woolworths #
3 85.1 96.1 supermarket #
4 15.4 22.3 cinema movie theatre #
5 22.2 **.5 gas petrol carwash #
6 97.3 68.1 petrol carwash #
7 80.0 **.7 carpark cafe shop #
8 46.8 43.3 hotel atm restaurant carpark #
9 87.3 42.3 cafe atm #
10 87.5 34.6 atm cafe shop #
11 24.7 4.4 theatre cinema atm carpark movie #
##########
11.8 3.5 53.5 28.5 cinema
19.**8.6 **.1 66.8 atm
16.9 67.6 74.8 93.4 petrol
49.0 70.**4.9 74.9 supermarket
75.1 25.1 99.9 49.9 cafe
You may assume that the test data always follows the format above. No input validity checking is needed.
You will be given a skeleton code ffle named program.c for this assignment on LMS. The skeleton code
ffle contains a main function that has been partially completed. There are a few other functions which are
incomplete. You need to add code to all the functions including the main function for the following tasks.
3.1 Stage 1: Read the POIs (Up to 5 Marks)
Your ffrst task is to add code to the stage_one function to read the POI records. You need to deffne a
struct named poi_t to represent a POI, and an array of this struct type to store all POI records. This
stage outputs (1) the number of POI records read, (2) the POI with the largest number of categories, and
(3) the categories of this POI. If there is a tie, print out the POI with the smallest ID among the tied ones.
Hint: Note the newline character ‘\n’ at the end of each input line if you use getchar to read the categories.
The output for this stage given the above sample input is shown in the next page (where “mac:” is the
command prompt).
2mac: ./program < test0.txt
Stage 1
==========
Number of POIs: 12
POI #2 has the largest number of categories:
shop supermarket atm coles woolworths
Like in Assignment 1, we will again use input redirection to feed test data into your program. Thus, you
should still use the standard input functions such as scanf or getchar to read the data. You do not need
to (and should not) use any ffle operation functions such as fopen or fread. Your program should not print
anything except for the data requested to be output (as shown in the output example).
You can also modify the stage_one function to read all input in one go. You can (and should) create further
functions to complete the tasks when opportunities arise.
3.2 Stage 2: Read and Process the Queries (Up to 10 Marks)
Add code to the stage_two function to read the queries. You will need to deffne another struct named
query_t to represent a query, and a linked list to store the input list of queries. You should adapt the
linked list structure and code given in the skeleton code for this purpose. Note: If you are not conffdent
with linked lists, you may use an array of the query_t type instead, assuming up to 20 queries. This will
cost a 2-mark deduction but will not impact the rest of your assignment implementation.
Then, add code to the process_queries function to go through the list (or array) of queries. For each
query, calculate and output the IDs of the POIs that are within the query range and match the query
category. You may use linear search to go through all POIs and their categories to process each query, and
do not need to use the advanced search algorithms described in Assignment 1.
We say that a POI at (x, y) is within a query range (xlb, ylb, xub, yub) if the following inequalities hold:
xlb ≤ x ≤ xub and ylb ≤ y ≤ yub (1)
Further, we say that a POI matches a query category if one of the categories of the POI is exactly the same
as the query category. The output for this stage given the above sample input should be:
Stage 2
==========
POIs in Q0: 4 11
POIs in Q1: none
POIs in Q2: 5
POIs in Q3: none
POIs in Q4: 7 9 10
Here, Qi to refer to the i-th input query. If there is no POI that satisffes a query, we output “none”. As an
example, for Q2, even though both POIs #2 and #5 are within the query range, only POI #5 matches the
query category petrol. Thus, only POI #5 is outputted.
3.3 Stage 3: Compute the Unique POI Categories (Up to 15 Marks)
Next, we consider a smarter strategy to search the POIs based on their categories. Stage 3 is a preparation
step for this purpose. Add code to the stage_three function to identify and output the list of all unique
POI category strings that have appeared in the input POI records. The POI categories should be outputted
in the order that they appear in the input. To simplify the assignment, you may assume that there are at
most 50 unique POI categories in the input, and you may use an array of strings to store the unique POI
categories. Given the sample input above, the output of this stage is shown below (5 categories per line).
Stage 3
==========
15 unique POI categories:
petrol, atm, carwash, shop, supermarket
coles, woolworths, cinema, movie, theatre
gas, carpark, cafe, hotel, restaurant
3Hint: Study words.c (https://people.eng.unimelb.edu.au/ammoffat/ppsaa/c/words.c) for how to
identify all unique words from input data and store them into an array.
3.4 Stage 4: Construct an Inverted Index (Up to 20 Marks)
Finally, add code to the stage_four function to construct an inverted index over the POI as follows:
1. Deffne a struct type named index_t of three ffelds:
• category, which is a string of up to 20 lower-case English letters;
• pois, which is an int array to store the IDs of all POIs that match the category; and
• num_matched_pois, which is the number of POIs that match the category.
For example, as shown in the sample output below, category cafe matches with POIs #7, #9, and #10.
These three POI IDs are supposed to be stored in the pois array corresponding to category cafe,
while num_matched_pois is 3.
2. Create an array of index_t type. Let us name this array index. This array will have the same size
as the array of unique POI categories created in Stage 3. Each element of the index array stores a
unique POI category in its category ffeld.
3. Sort the index array created in Step 2, in ascending alphabetical order (that is, dictionary order) of
the POI categories stored in the category ffeld of each array element.
Hint: You may adapt the insertion sort code from Assignment 1 for this step, or use the qsort function
from stdlib.h (see https://people.eng.unimelb.edu.au/ammoffat/ppsaa/c/callqsort.c for a
code example).
4. Go through the array of all POIs constructed in Stage 1, and each POI’s categories. For each category
(denoted by cat) of a POI, ffnd the element of the index array whose category ffeld matches cat.
Once such an element is found, add the ID of the POI to the end of the pois array of this element.
Hint: You may use either linear search or binary search for this step. If you use binary search, you
may adapt the binary search code from Assignment 1, or use the bsearch function from stdlib.h.
The output of this stage is the content of the index array, where each array element is printed in one line.
Given the sample input above, the output of this stage is as follows.
Stage 4
==========
atm: 0 1 2 8 9 10 11
cafe: 7 9 10
carpark: 7 8 11
carwash: 0 5 6
cinema: 4 11
coles: 2
gas: 5
hotel: 8
movie: 4 11
petrol: 0 5 6
restaurant: 8
shop: 2 7 10
supermarket: 2 3
theatre: 4 11
woolworths: 2
Query algorithm (for analysis and not for implementation). Once the inverted index is constructed,
when a query comes, we can run a binary search over the inverted index (that is, the index array) to ffnd
the array element whose category ffeld matches the query category. Then, we can perform a linear search
over the pois array of the found index array element to identify the POIs in the query range. For example,
for query Q4, we only need to examine POIs #7, #9, and #10.
At the end of your submission ffle, you need to add a comment that states:
1. the worst-case time complexity to process a single query using the linear search algorithm of Stage 2,
2. the worst-case time complexity to process a single query using the query algorithm described in the
paragraph above (without actually implementing it), and (continued on next page)
43. the reason why the two algorithms have those time complexities.
In your analysis, use N to denote the number of POIs, C to denote the maximum number of categories
per POI, L to denote the maximum length of a category, and U to denote the number of all unique POI
categories.
4 Submission and Assessment
This assignment is worth 20% of the ffnal mark (5% per stage). A detailed marking scheme will be provided
on LMS.
Submitting your code. You should put all your code for the assignment into a single ffle named
program.c. To submit your code, you will need to: (1) Log in to LMS subject site, (2) Navigate to
“Assignment 2” in the “Assignments” page, (3) Click on “Load Assignment 2 in a new window”, and
(4) follow the instructions on the Gradescope “Assignment 2” page and click on the “Submit” link to make
a submission. You can submit as many times as you want to. Only the last submission made before the
deadline will be marked. Submissions made after the deadline will be marked with late penalties as detailed
at the end of this document. Do not submit after the deadline unless a late submission is intended. Two
hidden tests will be run for marking purposes. Results of these tests will be released after the marking is done.
You can (and should) submit both early and often – to check that your program compiles correctly on
our test system, which may have some different characteristics to your own machines.
Testing on your own computer. You will be given a sample test ffle test0.txt and the sample output
test0-output.txt. You can test your code on your own machine with the following command and compare
the output with test0-output.txt:
mac: ./program < test0.txt /* Here ‘<’ feeds the data from test0.txt into program */
Note that we are using the following command to compile your code on the submission testing system (we
name the source code ffle program.c).
gcc -Wall -std=c17 -o program program.c -lm
The ffag “-std=c17” enables the compiler to use a modern standard of the C language – C17. To ensure
that your submission works properly on the submission system, you should use this command to compile
your code on your local machine as well.
You may discuss your work with others, but what gets typed into your program must be individual work,
not from anyone else. Do not give (hard or soft) copies of your work to anyone else; do not “lend” your
memory stick to others; and do not ask others to give you their programs “just so that I can take a look
and get some ideas, I won’t copy, honest”. The best way to help your friends in this regard is to say a
very ffrm “no” when they ask for a copy of, or to see, your program, pointing out that your “no”, and their
acceptance of that decision, is the only thing that will preserve your friendship. A sophisticated program that
undertakes deep structural analysis of C code identifying regions of similarity will be run over all submissions
in “compare every pair” mode. See https://academichonesty.unimelb.edu.au for more information.
Deadline: Programs not submitted by 4pm Tuesday 21 May 2024 will lose penalty marks at the rate
of 3 marks per day or part day late. Late submissions after 4pm Friday 24 May 2024 will not be accepted.
Students seeking extensions for medical or other “outside my control” reasons should email the lecturer at
jianzhong.qi@unimelb.edu.au. If you attend a GP or other health care professional as a result of illness,
be sure to take a Health Professional Report (HRP) form with you (get it from the Special Consideration
section of the Student Portal), you will need this form to be fflled out if your illness develops into something
that later requires a Special Consideration application to be lodged. You should scan the HPR form and
send it in connection with any non-Special Consideration assignment extension requests.

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











 

掃一掃在手機打開當前頁
  • 上一篇:CHC5223代做、java程序設計代寫
  • 下一篇:大學生寫代碼兼職接單群
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

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

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产成人免费91av在线| 久久久久久亚洲| 日韩国产高清一区| 色播亚洲婷婷| 日韩中文字幕在线免费| 日韩av大片在线| 日韩av中文字幕第一页| 人妻精品无码一区二区三区| 欧美性受xxxx黑人猛交| 精品免费视频123区| 国产一二三区在线播放| 国产老熟妇精品观看| jizzjizz国产精品喷水| 国产精品av在线播放 | 久久久人人爽| 久久久久久久久久码影片| 久久久91精品国产一区不卡| 国产精品久久一区| 国产99久久精品一区二区 夜夜躁日日躁 | 一区二区视频在线播放| 在线观看成人av| 日本一区视频在线观看免费| 人妻无码久久一区二区三区免费| 国内视频一区| 成人亚洲综合色就1024| 久久最新免费视频| 久久久久www| 亚洲国产精品一区二区第四页av | 免费一级特黄特色毛片久久看| 国产在线一区二区三区四区| 福利在线一区二区| 国产成人精品免高潮在线观看| 久久精品电影网站| 色综合91久久精品中文字幕| 亚洲精品成人久久久998| 人人妻人人澡人人爽欧美一区双| 麻豆精品视频| 成人久久精品视频| 色黄久久久久久| 宅男一区二区三区| 青青草国产精品视频| 粉嫩av四季av绯色av第一区| 日韩在线视频网| 亚洲尤物视频网| 黄色国产精品视频| 久久精品一二三区| 欧美激情精品久久久| 欧美日韩国产不卡在线看| 九九九九久久久久| 亚洲美女搞黄| 国产性生活免费视频| 久久久久久久久一区| 亚洲一区不卡在线| 精品午夜一区二区| 久久久久久久久久伊人| 亚洲第一页在线视频| 精品少妇人妻av一区二区| 久久综合久久色| 欧美激情精品久久久久久大尺度| 欧洲中文字幕国产精品| 91免费黄视频| 美女久久久久久久久久久| 欧美性大战久久久久xxx| 久色视频在线播放| 一本久道久久综合狠狠爱亚洲精品| 欧美一区少妇| 久久久久久久久久久福利| 亚洲在线色站| 国产伦精品一区二区三区视频免费| www亚洲精品| 日韩精品欧美专区| 国产av人人夜夜澡人人爽麻豆| 亚洲一区三区在线观看| 国产美女精彩久久| 欧美日韩第一视频| 国产熟人av一二三区| 操91在线视频| 国产亚洲福利社区| 欧美大成色www永久网站婷| 欧美久久在线| 久久久精品国产一区二区| 青青久久av北条麻妃黑人| 91干在线观看| 欧美一区二区视频在线| 97免费中文视频在线观看| 中文字幕一区二区三区有限公司| 国产日韩欧美视频| 久久国产色av| 国产精品综合久久久久久| 精品国产区在线| 国产区精品视频| 欧美激情中文网| 成人在线观看毛片| 午夜精品一区二区在线观看| 国产精品999视频| 色综合电影网| 久久精品成人一区二区三区蜜臀 | 日本三级韩国三级久久| 国产a级黄色大片| 欧美一二三不卡| 国产精品视频在线播放| 免费看a级黄色片| 欧美精品福利在线| 91精品国产综合久久香蕉| 性色av一区二区三区在线观看| 久久久综合香蕉尹人综合网| 日韩欧美精品在线观看视频| 日韩中文字幕国产| 免费看国产精品一二区视频| 精品国产一区三区| 国产伦精品一区二区三区照片| 中文字幕无码不卡免费视频| 久久久久久艹| 国内精品久久久久久久果冻传媒| 国产99久久精品一区二区 | 欧美精品激情在线| 国产经典一区二区三区| 日韩亚洲欧美视频| 国产精品久久久久不卡| 国产日韩欧美亚洲一区| 亚洲不卡中文字幕无码| 日韩有码在线播放| 国产美女精品视频| 日韩免费av一区二区| 欧美精品手机在线| 131美女爱做视频| 国模精品一区二区三区| 亚洲精品乱码久久久久久自慰| 色婷婷av一区二区三区在线观看| 精品一卡二卡三卡四卡日本乱码| 亚洲区一区二区三区| 日韩中文有码在线视频| 国产美女主播在线| 日韩欧美精品在线观看视频| 国产精品福利观看| 91免费看片网站| 精品一区二区日本| 日本欧美中文字幕| 欧美日本亚洲视频| 91精品国产高清久久久久久91| 黄色一级一级片| 天天好比中文综合网| 久久成人这里只有精品| 国产超碰91| 欧美激情亚洲国产| 久久精品小视频| 久久久神马电影| 黄页免费在线观看视频| 亚洲精品国产精品久久| 久久久精品电影| 久久久在线观看| 国产欧美久久久久久| 日韩国产高清一区| 亚洲伊人成综合成人网| 国产精品久久久久高潮| 日韩中文字幕不卡视频| 久久综合久久色| 波多野结衣成人在线| 精品一区2区三区| 欧美日韩国产三区| 日本一欧美一欧美一亚洲视频| 综合色婷婷一区二区亚洲欧美国产| 国产精品久久久久久中文字| 日韩在线视频线视频免费网站| 国产精成人品localhost| 国产日韩欧美日韩大片| 国内成+人亚洲| 欧美日韩免费观看一区| 日韩欧美精品久久| 日本一区二区视频| 少妇久久久久久被弄到高潮| 亚洲直播在线一区| 亚洲午夜久久久影院伊人| 久久成年人免费电影| 国产精品裸体瑜伽视频| 国产精品丝袜久久久久久不卡 | 欧美中文字幕第一页| 日本在线视频www| 少妇免费毛片久久久久久久久| 亚洲伊人第一页| 亚洲永久免费观看| 亚洲影院污污.| 午夜啪啪免费视频| 欧美一级免费播放| 日本不卡一区二区三区视频| 日韩欧美视频一区二区 | 国产日本欧美一区二区三区在线| 国内免费久久久久久久久久久| 欧美激情专区| 欧美亚洲国产日韩2020| 欧洲日韩成人av| 欧美日韩亚洲一二三| 黄频视频在线观看| 国产一区二区自拍| 国产一区视频免费观看| 成人久久一区二区| 久久久亚洲精品无码| 九九九九免费视频| 国产精品美乳在线观看| 久久亚洲一区二区三区四区五区高|