有需要的朋友qq 1703105484

COMP9024 22T1
Prof Aaron Quigley
Large Assignment
The World of Worlde

Thanks to

Michael Thilscher for the base cases in this assignment

Change Log

We may make minor changes to the spec to address/clarify some outstanding issues. These may require minimal changes in your design/code, if at all. Students are strongly encouraged to check the change log regularly.

----------

  • Version 1: Released on 25th March 2022
  • Version 2: Released on 28th March 2022
    Stages 1-4 to also prompt "Enter start word". Enter # to indicate the desired output is maximal sequences.
  • Version 3: Released on 29th March 2022
    Stage 5 changed to be more consistent with stages 1-4.
    Input, output and all word sequences are required to be alphabetically sorted.
    Fixed incorrect sequence length in previous example.
    Input words are not guaranteed to be all the same length.

Objectives

The assignment aims to give you more independent, self-directed practice with

  • advanced data structures, especially graphs
  • graph algorithms

Admin

Marks 2 marks for stage 1 (correctness)
2 marks for stage 2 (correctness)
2 marks for stage 3 (correctness)
3 marks for stage 4 (correctness)
2 marks for stage 5 (correctness)
1 mark for style
———————
Total: 12 marks
Due 11:00:00am on Monday 18 April (week 10)
Late 2 marks (= ⅙ of the maximum mark) off the ceiling per day late
(e.g. if you are 25 hours late, your maximum possible mark is 8)

Context

Word and letter guessing games are as old as written languages themselves. They can be seen in everything from the television show the Wheel of Fortune on NBC/ABC to Wordle, which has been owned and published by The New York Times Company since 2022. Guessing missing letters, permutations of letters of trying to guess the correct location for letters in words are common game styles. In this assignment we will explore the foundations of such games with word sequences.

Aim

word sequence is a sequence of k ≥ 1 words:

ω1 → ω2 → ω3 → … → ωk-1 → ωk

in which

  • words are ordered alphabetically, and
  • two consecutive words ωi and ωi+1 differ by only one letter:
    1. either they are of the same length with one letter different, e.g.  tail → tall
    2. or one letter is missing or added, e.g.  grater → greater  or  scent → sent.

An example is the following word sequence of length k = 8:

cold → cord → core → corse → horse → hose → host → hot

Your first task (across stage 1-4) is to develop a program to compute the longest word sequences that can be created given a collection of words. Following this (in stage 5), you are asked to complete the development of a Wordle-like shortest path check

Input

Your program should start by prompting the user to input a positive number n, then prompt the user to input n words.

Hint:

You may assume that

  • the input is syntactically correct (a number n ≥1 followed by n words);
  • all words are input in alphabetical order;
  • each single word has a maximum of 31 letters;
  • only the 26 lowercase letters  a – z  will be used;
  • the maximum number of words will be 100.

Output

  • Task 1: For each word ω, compute and output all the words that could be used as the next word after ω in a word sequence.

  • Task 2: Compute and output

    1. the maximum length of a word sequence that can be built from the words in the input,

    2. all word sequences of maximum length that can be built from the set of words in the input.

Stage 1 (2 marks)

For stage 1, you need to demonstrate that you can build the underlying graph under the assumption that all words have the same length.

Any test for this stage will have only words of equal length and such that all the words together form a word sequence. Hence, this stage focuses on Task 1, and for Task 2 you can just output the total number of words (= maximum length of a sequence) and a sequence containing all the words (= the only maximal sequence).

Here is an example to show the desired behaviour of your program for a stage 1 test:

./words
Enter a number: 6
Enter a word: lad
Enter a word: lag
Enter a word: lap
Enter a word: tap
Enter a word: tip
Enter a word: top
Enter start word: #lad: lag lap
lag: lap
lap: tap
tap: tip top
tip: top
top:Maximum sequence length: 6
Maximal sequence(s):
lad -> lag -> lap -> tap -> tip -> top

Stage 2 (2 marks)

For stage 2, you should demonstrate that you can find one maximal sequence under the assumption that all words have the same length.

Any test for this stage will be such that all words are of equal length and such that there is only one maximal word sequence.

Here is an example to show the desired behaviour of your program for a stage 2 test:

./words
Enter a number: 8
Enter a word: bad
Enter a word: ban
Enter a word: dad
Enter a word: dan
Enter a word: lad
Enter a word: lap
Enter a word: mad
Enter a word: tap
Enter start word: #bad: ban dad lad mad
ban: dan
dad: dan lad mad
dan:
lad: lap mad
lap: tap
mad:
tap:Maximum sequence length: 5
Maximal sequence(s):
bad -> dad -> lad -> lap -> tap

Stage 3 (2 marks)

For stage 3, you should extend your program for stage 2 such that words can be of different length.

Tests for this stage are also guaranteed to have just one word sequence of maximum length.

Here is an example to show the desired behaviour of your program for a stage 3 test:

./words
Enter a number: 6
Enter a word: east
Enter a word: eat
Enter a word: eats
Enter a word: fast
Enter a word: fist
Enter a word: foist
Enter start word: #east: eat fast
eat: eats
eats:
fast: fist
fist: foist
foist:Maximum sequence length: 4
Maximal sequence(s):
east -> fast -> fist -> foist

Stage 4 (3 marks)

For stage 4, you should extend your stage 3 program such that it outputs

  • all word sequences of maximal length
  • in alphabetical order.

Here is an example to show the desired behaviour of your program for a stage 4 test:

./words
Enter a number: 5
Enter a word: east
Enter a word: eat
Enter a word: eats
Enter a word: fast
Enter a word: fist
Enter start word: #east: eat fast
eat: eats
eats:
fast: fist
fist:Maximum sequence length: 3
Maximal sequence(s):
east -> eat -> eats
east -> fast -> fist

Note:

  • It is a requirement that the sequences are output in alphabetical order.

Stage 5 (2 marks) - "Wordle like"

For stage 5, you should revise your stage 4 program such that it outputs

  • All word sequences of minimal length
  • In alphabetical order
  • Given a start word and end word

Here is an example to show the desired behaviour of your program for a stage 5 test:

./words
Enter a number: 5
Enter a word: east
Enter a word: eat
Enter a word: eats
Enter a word: fast
Enter a word: fist
Enter start word: east
Enter end word: eatsMinimum sequence length: 3
Minimal sequence(s):
east -> eat -> eats

Hints

If you find any of the following ADTs from the course useful, then you can, and indeed are encouraged to, use them with your program:

  • linked list ADT :   list.h, list.c
  • stack ADT :   stack.h, stack.c
  • queue ADT :   queue.h, queue.c
  • priority queue ADT :   PQueue.h, PQueue.c
  • graph ADT :   Graph.h, Graph.c
  • weighted graph ADT :   WGraph.h, WGraph.c

You are free to modify any of the six ADTs for the purpose of the assignment (but without changing the file names). If your program is using one or more of these ADTs, you should submit both the header and implementation file, even if you have not changed them.

Your main program file words.c should start with a comment: /* … */ that contains the time complexity of your program in Big-Oh notation, together with a short explanation.

Testing

We have created a script that can automatically test your program. To run this test you can execute the dryrun program for the corresponding assignment, i.e. words. It expects to find, in the current directory, the program words.c and any of the admissible ADTs (Graph,WGraph,stack,queue,PQueue,list) that your program is using, even if you use them unchanged. You can use dryrun as follows:

9024 dryrun words

Please note: Passing the dryrun tests does not guarantee that your program is correct. You should thoroughly test your program with your own test cases.

Submit

For this project you will need to submit a file named words.c and, optionally,
any of the ADTs (Graph,WGraph,stack,queue,PQueue,list) that your program is using, even if you have not changed them.

You can either submit through WebCMS3 or use a command line.

For example, if your program uses the Graph ADT and the list ADT, then you should submit:

give cs9024 assn words.c Graph.h Graph.c list.h list.c

Do not forget to add the time complexity to your main source code file words.c.

You can submit as many times as you like — later submissions will overwrite earlier ones. You can check that your submission has been received on WebCMS3 or by using the following command:

9024 classrun -check assn

Marking

This project will be marked on functionality in the first instance, so it is very important that the output of your program be exactly correct as shown in the examples above. Submissions which score very low on the automarking will be looked at by a human and may receive a few marks, provided the code is well-structured and commented.

Programs that generate compilation errors will receive a very low mark, no matter what other virtues they may have. In general, a program that attempts a substantial part of the job and does that part correctly will receive more marks than one attempting to do the entire job but with many errors.

Style considerations include:

  • Readability
  • Structured programming
  • Good commenting

Plagiarism

Group submissions will not be allowed. Your programs must be entirely your own work. Plagiarism detection software will be used to compare all submissions pairwise (including submissions for similar assessments in previous years, if applicable) and serious penalties will be applied, including an entry on UNSW's plagiarism register.

  • Do not copy ideas or code from others
  • Do not use a publicly accessible repository or allow anyone to see your code

Please refer to the on-line sources to help you understand what plagiarism is and how it is dealt with at UNSW:

  • Plagiarism and Academic Integrity
  • UNSW Plagiarism Policy Statement
  • UNSW Plagiarism Procedure

Help

See FAQ for some additional hints.

Finally …

Have fun! Aaron

Reproducing, publishing, posting, distributing or translating this page is an infringement of copyright and will be referred to UNSW Conduct and Integrity for action.

qq

1703105484

COMP9024 22T1Prof Aaron Quigley相关推荐

  1. 史元春老师组20-21年论文笔记

    Chen Liang, Chun Yu, Xiaoying Wei, Xuhai Xu, Yongquan Hu, Yuntao Wang, Yuanchun Shi: Auth+Track: Ena ...

  2. 计算机天才Aaron Swartz 名作 《如何提高效率》——纪念真正的“hacker!

    如何提高效率 <HOWTO: Be more productive>(如何提高效率)作者:Aaron Swartz 肯定有人跟你说过这样的话,"你有看电视的那么长时间,都可以用来 ...

  3. Aaron Stannard谈Akka.NET 1.1

    Akka.NET 1.1近日发布,带来新特性和性能提升.InfoQ采访了Akka.net维护者Aaron Stannard,了解更多有关Akka.Streams和Akka.Cluster的信息.Aar ...

  4. signature=a95d3b624ea7b2de0432eee0b4f584d9,Braves mourn Hank Aaron

    ATLANTA -- As Brian Jordan discussed Hank Aaron's passing on Friday, he expressed the sentiments of ...

  5. 如何提高效率By Aaron Swartz (转载)

    天才的逝去总是让世人扼腕不息,今天从微博看到Aaron Swartz commits suicide,生命的脆弱让人唏嘘.转载一篇Aaron Swartz关于如何提高效率的文章,以此向这位天才致敬. ...

  6. Aaron Swartz:如何提高效率

    为什么80%的码农都做不了架构师?>>>    Aaron Swartz写过一篇很有名的文章,叫做<HOWTO: Be more productive>(如何提高效率). ...

  7. 如何提高效率 Aaron Swartz

    Aaron Swartz写过一篇很有名的文章,叫做<HOWTO: Be more productive>(如何提高效率).这篇文章写得实在是太好了,我看了好多遍,很赞同作者的观点.我借鉴了 ...

  8. 亚伦斯沃特斯_盒装首席执行官亚伦·莱维(Aaron Levie)胜过科技巨头和股票市场

    亚伦斯沃特斯 大技术 (Big Technology) OneZero is partnering with Big Technology, a newsletter and podcast by A ...

  9. 互联网之子 Aaron Swarts 想要看到的世界

    Jade和我偶尔会聊起一些宏大的话题,最近聊到了Aaron和互联网创建者们的一些历史.她觉得应该正经的来一次对话,记录下来分享给其他人.我们约了个时间,原计划聊2个小时,实际上聊了5个小时.最后形成了 ...

最新文章

  1. 美多商城之支付(支付宝介绍)
  2. 2019年度最全IT吃瓜指南
  3. OpenCV图像处理使用笔记(三)——单通道的Mat对象强转为三通道的Mat对象
  4. 触摸屏mtp文件转c语言,F28335与上位机(触摸屏)之间的通讯遵循modbus协议使用C语言编程...
  5. 一个电脑多个github、gitlab、oschina账户
  6. mysql 视图锁_如何诊断和处理锁等待
  7. 使用Spring JDBC时遇到的Software caused connection abort: recv failed问题
  8. Linux学习总结(41)——运维不仅仅是Linux
  9. 信息熵(Information Entropy)
  10. java改变实参_java中引用传递问题,在函数中修改引用的指向,会不会影响实参?...
  11. Golang的cookie
  12. Ubuntu12.04 apt-get 安装mysql
  13. mysql数据库 性别 优化_BATJ解决千万级别数据之MySQL 的 SQL 优化大总结
  14. Web应用程序中Resource Bundle技术概述
  15. pyLDA系列︱gensim中的主题模型(Latent Dirichlet Allocation)
  16. 什么是Instagram直播购物?如何设置Instagram 直播购物?
  17. GitHub上收录400余篇任正非的讲话稿
  18. Python cv2读取/存储图片中含中文路径失败的解决方法
  19. Idea设置ALT+/代码提示
  20. Google(谷歌)拼音输入法发布

热门文章

  1. 重磅!信通院发布可信云最新评估结果
  2. 最近比较烦。。。。。。。。
  3. IOS进入DFU模式通过iTunes恢复系统
  4. Icesword 驱动部分分析
  5. 91熊猫看书电脑版 v0.8.0|官方安装版下载
  6. vce 题库导入_VCE Converter下载|VCE题库文件转换工具最新免费版V1.0 下载_当游网...
  7. 酷比魔方i7手写版linux网卡驱动,酷比魔方i7手写板,Ubuntu 18.04,RTL8723BU wifi驱动安装...
  8. Python实现trim函数
  9. VOS3000作用与功能
  10. 白话机器学习算法——笔记