99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代寫COMP9021object-oriented Python  程序
代寫COMP9021object-oriented Python  程序

時間:2025-11-08  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Assignment 2
COMP9021, Trimester 3, 2025
1 General matters
1.1 Aim
The purpose of the assignment is to:
• develop object-oriented Python programs with proper exception handling;
• parse and analyse combinatorial structures;
• generate TikZ/LaTeX diagrams programmatically;
• handle both small and complex structures efficiently.
1.2 Submission
Your program should be stored in a file named arches.py, optionally together with additional files. After
developing and testing your program, upload it via Ed (unless you worked directly in Ed). Assignments
can be submitted multiple times; only the last submission will be graded. Your assignment is due on
November 24 at 11:59am.
1.3 Assessment
The assignment is worth 13 marks and will be tested against multiple inputs. For each test, the au tomarking script allows your program to run for 30 seconds.
Assignments may be submitted up to 5 days after the deadline. The maximum mark decreases by 5% for
each full late day, up to a maximum of five days. For example, if students A and B submit assignments
originally worth 12 and 11 marks, respectively, two days late (i.e., more than 24 hours but no more than
48 hours late), the maximum mark obtainable is 11.7. Therefore, A receives min(11.7, 12) = 11.7 and B
receives min(11.7, 11) = 11.
Your program will generate a number of .tex files. These can be given as arguments to pdflatex to
produce PDF files. Only the .tex files will be used to assess your work, but generating the PDFs should
still give you a sense of satisfaction. The outputs of your programs must exactly match the expected
outputs. You are required to use the diff command to identity any differences between
the .tex files generated by your program and the provided reference .tex files. You are
responsible for any failed tests resulting from formatting discrepancies that diff would have
detected.
1.4 Reminder on plagiarism policy
You are encouraged to discuss strategies for solving the assignment with others; however, discussions
must focus on algorithms, not code. You must implement your solution independently. Submissions are
routinely scanned for similarities that arise from copying, modifying others’ work, or collaborating too
closely on a single implementation. Severe penalties apply.
1
2 Open Meanders
2.1 Background
An open meander is a combinatorial structure represented as a non-self-intersecting curve that crosses a
horizontal line of points, forming arches above and below the line. They can be described by permutations
with specific constraints.
Formally, let (a1, a2, . . . , an) be a permutation of {1,…, n} with n ≥ 2. Each integer corresponds to a
distinct point on a fixed horizontal line. The permutation defines a sequence of arches as follows:
• The first arch is an upper arch, drawn above the line.
• Subsequent arches alternate between upper and lower positions, forming a valid open meander.
• Each arch connects two consecutive points ai and ai+1 in the permutation. The orientation of each
arch depends on the relative order of these points:
– An arch is drawn from left to right if ai < ai+1.
– An arch is drawn from right to left if ai > ai+1.
• Arches on the same side do not intersect.
The collection of upper and lower arches can be represented symbolically using extended Dyck words—
one for each side of the line:
• ( corresponds to the left endpoint of an arch.
• ) corresponds to the right endpoint of an arch.
• 1 represents an end of the curve (a free endpoint) that lies on that side.
The position of the endpoints depends on the parity of n:
• For even n, both ends of the curve lie below the line.
• For odd n, one end lies above and the other below the line.
Each extended Dyck word therefore encodes the complete structure of the arches on its respective side,
though only together do the two sides represent the full open meander.
2.2 Examples
For a first example, consider the permutation (2, 3, 1, 4) and the corresponding generated diagram open_me anders_1.pdf.
• Upper arches extended Dyck word: (())
• Lower arches extended Dyck word: (1)1
For a second example, consider the permutation (1, 10, 9, 4, 3, 2, 5, 8, 7, 6) and the corresponding generated
diagram open_meanders_2.pdf.
2
• Upper arches extended Dyck word: (()((())))
• Lower arches extended Dyck word: 1(())1()()
For a third example, consider the permutation (5, 4, 3, 2, 6, 1, 7, 8, 13, 9, 10, 11, 12) and the corresponding
generated diagram open_meanders_3.pdf.
• Upper arches extended Dyck word: (()())()(()1)
• Lower arches extended Dyck word: ((()1))(()())
2.3 Requirements
Implement in arches.py a class OpenMeanderError(Exception) and a class OpenMeander.
Objects of type OpenMeander are created with OpenMeander(a_1, a_2, ..., a_n), where the arguments
form a permutation of {1,…, n} for some n ≥ 2. You may assume that all arguments are integers.
• If the arguments do not form a permutation of {1,…, n} for some n ≥ 2, raise
OpenMeanderError('Not a permutation of 1, ..., n for some n ≥ 2').
• If they do not define a valid open meander, raise
OpenMeanderError('Does not define an open meander').
Implement in OpenMeander three attributes:
• extended_dyck_word_for_upper_arches, a string representing the upper arches;
• extended_dyck_word_for_lower_arches, a string representing the lower arches;
• draw(filename, scale=1), a method that generates a TikZ/LaTeX file drawing the open meander.
No error checking is required in the implementation of draw(filename, scale=1). You may assume that
filename is a valid string specifying a writable file name, and that scale is an integer or floating-point
number (typically chosen so that the resulting picture fits on a page).
An example interaction is shown in open_meanders.pdf.
Carefully study the three example .tex files. Note that the horizontal baseline extends one unit beyond
each end of the curve. Also note that the scale common to x and y, as well as the values for radius, are
displayed as floating-point numbers with a single digit after the decimal point. The length of the ends of
strings is computed as half of the scale of x and y, and is also displayed as a floating-point number with
a single digit after the decimal point.
3 Dyck Words and Arch Diagrams
3.1 Background
A Dyck word is a balanced string of parentheses representing a system of nested arches above a horizontal
line. The depth of an arch is the number of arches it is nested within, providing a way to analyse the
hierarchical structure.
3
For example, the Dyck word (()(()(()))) contains arches of depth 0, 1, 2, and 3. Dyck words can be
visualised as arches drawn above a horizontal line, with nesting reflected in the vertical stacking of arches.
Unlike open meanders, Dyck words involve only one side of arches (above the line) and do not include
endpoints represented by 1. They provide a simplified context for studying nesting depth and arch
diagrams, and arches can optionally be visually distinguished by color according to their depth.
When colouring is applied, the following sequence is used: Red, Orange, Goldenrod, Yellow, LimeGreen,
Green, Cyan, SkyBlue, Blue, Purple. If the maximum depth exceeds 9, the sequence wraps around. For
example, depth 10 would use Red again, depth 11 Orange, etc.
3.2 Examples
For a first example, consider the Dyck word (((((((((((((()))))))))))))) and the corresponding
generated diagrams, drawn_dyck_word_1.pdf and coloured_dyck_word_1.pdf.
• There is 1 arch of depth 0.
• There is 1 arch of depth 1.
• There is 1 arch of depth 2.
• There is 1 arch of depth 3.
• There is 1 arch of depth 4.
• There is 1 arch of depth 5.
• There is 1 arch of depth 6.
• There is 1 arch of depth 7.
• There is 1 arch of depth 8.
• There is 1 arch of depth 9.
• There is 1 arch of depth 10.
• There is 1 arch of depth 11.
• There is 1 arch of depth 12.
• There is 1 arch of depth 13.
For a second example, consider the Dyck word (()(()(()))) and the corresponding generated diagrams,
drawn_dyck_word_2.pdf and coloured_dyck_word_2.pdf.
• There are 3 arches of depth 0.
• There is 1 arch of depth 1.
• There is 1 arch of depth 2.
• There is 1 arch of depth 3.
For a third example, consider the Dyck word ((()())(()(()()))) and the corresponding generated
diagrams, drawn_dyck_word_3.pdf and coloured_dyck_word_3.pdf.
4
• There are 5 arches of depth 0.
• There are 2 arches of depth 1.
• There is 1 arch of depth 2.
• There is 1 arch of depth 3.
For a fourth example, consider the Dyck word ((()(()())(()(()(())))((()()))()(()()))) and the
corresponding generated diagrams, drawn_dyck_word_4.pdf and coloured_dyck_word_4.pdf.
• There are 11 arches of depth 0.
• There are 4 arches of depth 1.
• There are 2 arches of depth 2.
• There is 1 arch of depth 3.
• There is 1 arch of depth 4.
• There is 1 arch of depth 5.
3.3 Requirements
Implement in arches.py a class DyckWordError(Exception) and a class DyckWord.
Objects of type DyckWord are created with DyckWord(s), where the argument s is a nonempty string of
parentheses. You may assume that the argument is a string.
• If the argument is the empty string, raise
DyckWordError('Expression should not be empty').
• Otherwise, if the argument contains characters other than parentheses, raise
DyckWordError("Expression can only contain '(' and ')'").
• Otherwise, if the string is not balanced, raise
DyckWordError('Unbalanced parentheses in expression').
Implement in DyckWord three attributes:
• report_on_depths(), a method that outputs the number of arches at each depth, ordered from
smallest to largest depth;
• draw_arches(filename, scale=1), a method that generates a TikZ/LaTeX file drawing the arches;
• colour_arches(filename, scale=1), a method that generates a TikZ/LaTeX file drawing the
arches coloured according to their depth.
5
No error checking is required in the implementation of both methods. You may assume that filename
is a valid string specifying a writable file name, and that scale is an integer or floating-point number
(typically chosen so that the resulting picture fits on a page).
An example interaction is shown in dyck_words.pdf.
Carefully study the eight example .tex files (four for drawing arches, four for colouring arches). Note
that the horizontal baseline extends one unit beyond the leftmost and rightmost arches. Note that the
scale common to x and y is displayed as a floating-point number with a single digit after the decimal
point. Arches are drawn from the leftmost left end to the rightmost left end. Arches are coloured
from largest depth to smallest depth, and for arches of the same depth, from leftmost left end to
rightmost left end.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機打開當前頁
  • 上一篇:代寫COMP3020J encryptors and decryptors 程序&#160;
  • 下一篇:代寫comp3211程序代做 &#160;IoT Framework&#160;
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                欧美一级欧美三级| 性感美女极品91精品| 亚洲综合视频网| 欧美综合天天夜夜久久| 亚洲一二三级电影| 日韩精品一区二区三区swag| 成人一级视频在线观看| 亚洲国产毛片aaaaa无费看| 欧美一级xxx| 国产乱码精品1区2区3区| 亚洲三级免费电影| 欧美一区二区免费视频| 国产不卡一区视频| 亚洲二区在线观看| 国产人久久人人人人爽| 欧美体内she精高潮| 国产激情一区二区三区| 亚洲欧美日韩国产成人精品影院| 91免费视频观看| 日韩av中文字幕一区二区三区| 国产偷v国产偷v亚洲高清| 色哟哟亚洲精品| 久久国产精品99精品国产| 亚洲欧洲日本在线| 久久日韩粉嫩一区二区三区| 91福利社在线观看| 国产aⅴ精品一区二区三区色成熟| 亚洲一区二区在线播放相泽| 国产午夜亚洲精品午夜鲁丝片| 欧美性大战久久久久久久| 国产高清久久久| 看电视剧不卡顿的网站| 亚洲成a人片综合在线| 亚洲欧洲av在线| 久久久青草青青国产亚洲免观| 欧美嫩在线观看| 欧美中文字幕一区二区三区 | 欧美日韩国产免费| 国产999精品久久| 久久机这里只有精品| 午夜精品爽啪视频| 一区二区三区精品视频在线| 国产精品午夜免费| 久久久久久一二三区| 日韩精品一区二| 欧美一区二区三级| 制服.丝袜.亚洲.另类.中文 | 国产精品国产三级国产aⅴ中文 | 欧美日韩成人一区二区| 91麻豆蜜桃一区二区三区| 成人午夜电影小说| 成人小视频免费在线观看| 免费成人在线影院| 日日摸夜夜添夜夜添亚洲女人| 亚洲一区免费观看| 亚洲影院久久精品| 亚洲国产毛片aaaaa无费看 | 日本不卡免费在线视频| 婷婷一区二区三区| 日本在线不卡视频| 麻豆精品视频在线| 精品免费一区二区三区| 久久久久久久久伊人| 国产欧美日韩精品a在线观看| 久久精品综合网| 亚洲天堂av老司机| 亚洲综合在线五月| 午夜影院久久久| 青青草原综合久久大伊人精品 | 日本黄色一区二区| 欧美日韩国产首页| 欧美一卡二卡三卡四卡| 久久精品一区二区三区四区| 国产精品久久久久一区二区三区共| 亚洲欧美在线视频| 亚洲自拍偷拍图区| 日本成人在线不卡视频| 国内精品免费**视频| 成人午夜视频在线观看| 欧美性一级生活| 日韩女同互慰一区二区| 日本一区二区电影| 午夜一区二区三区视频| 国产精品一区二区三区四区| 91丨porny丨首页| 91精品国产综合久久精品图片| 日韩欧美国产麻豆| 中文字幕在线观看一区| 日本不卡一区二区三区高清视频| 国产成人8x视频一区二区| 91美女精品福利| 欧美电影免费观看高清完整版在线| 国产欧美日韩不卡| 午夜精品在线视频一区| 韩国欧美国产1区| 色八戒一区二区三区| 精品国精品自拍自在线| 夜夜亚洲天天久久| 国产91色综合久久免费分享| 制服丝袜av成人在线看| 亚洲欧洲一区二区三区| 狠狠色丁香婷婷综合| 9191久久久久久久久久久| 91成人免费在线视频| 国产精品亲子伦对白| 免费在线一区观看| 欧美日韩一区二区电影| 亚洲欧美在线观看| 国产精品1024久久| 日韩女优av电影| 午夜成人免费电影| 一本色道综合亚洲| 国产亚洲欧美日韩在线一区| 免费在线观看日韩欧美| 色综合久久88色综合天天免费| 欧美极品少妇xxxxⅹ高跟鞋| 久久66热偷产精品| 日韩一区二区在线看片| 日韩av电影天堂| 日韩视频免费观看高清在线视频| 一区二区在线看| 91影视在线播放| 国产精品久久久久影院老司| 国产91精品免费| 久久久av毛片精品| 国产一区二区导航在线播放| 精品国产一区久久| 黄色日韩三级电影| 久久久久国产精品麻豆ai换脸| 精品在线一区二区三区| 精品久久久久久久久久久久久久久 | 久久这里只有精品首页| 国产精品三级av在线播放| 国产精品亚洲第一区在线暖暖韩国 | 欧美精品丝袜中出| 亚洲成人1区2区| 欧美精选在线播放| 午夜久久福利影院| 91精品国产福利| 久久机这里只有精品| 久久亚洲二区三区| bt7086福利一区国产| 亚洲免费观看在线观看| 欧美日韩免费一区二区三区| 日韩国产精品91| 久久久久国产免费免费| 99久久综合99久久综合网站| 一区二区在线观看不卡| 欧美一二三区精品| 国产91丝袜在线播放九色| 中文字幕一区二区三区四区| 欧美午夜影院一区| 精品无人码麻豆乱码1区2区| 国产精品无码永久免费888| 一本一道波多野结衣一区二区| 丝袜诱惑制服诱惑色一区在线观看| 欧美一级片在线| 国产a区久久久| 亚洲国产你懂的| 2021久久国产精品不只是精品| 成人久久久精品乱码一区二区三区 | 亚洲国产日韩a在线播放性色| 久久疯狂做爰流白浆xx| 午夜精品久久久久久| 91黄视频在线| 91捆绑美女网站| 成人免费不卡视频| 国产suv精品一区二区三区| 日本aⅴ亚洲精品中文乱码| 日韩精品亚洲一区| 午夜免费久久看| 日韩电影一区二区三区四区| 天天影视网天天综合色在线播放 | 国产传媒久久文化传媒| 在线播放国产精品二区一二区四区| 亚洲综合小说图片| 成人爽a毛片一区二区免费| 午夜免费久久看| 亚洲欧美在线另类| 日韩精品专区在线| 91成人在线精品| 成人黄色在线网站| 久久精品久久综合| 亚洲h在线观看| 国产精品免费av| 欧美精品一区二区精品网| 欧美日韩美女一区二区| 成人久久18免费网站麻豆| 经典三级视频一区| 日本不卡视频在线| 亚洲动漫第一页| 国产精品理论片在线观看| 久久午夜电影网| 日韩一二三四区| 91 com成人网| 欧美日韩美少妇| 欧美日韩小视频| 麻豆一区二区三| 麻豆成人久久精品二区三区小说| 亚洲成人av福利|