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

代做SEHH2239、Python程序語言代寫

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



SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 1 of 7
Assignment 2 (Individual Assignment)
Due Date
19 April 2024 17:00 (Friday)
Late submission is liable to a penalty of 10% of the available marks for each day late; Saturdays, Sundays
and holidays are counted. Submission after 24 April 2024 17:00 will not be accepted.
Declaration of Original Work
Plagiarism is a serious misconduct. No part of students’ assignment should be taken from other people’s
work without giving them credit. All references must be clearly cited. Any plagiarism found in students’
completed assignments can lead to disciplinary actions such as mark deduction, disqualification or even
expulsion by the College.
In principle, CPCE considers GenAI tools as positive and creative forces in education and encourages their
use in learning, teaching, and assessment. However, extensive copy-pasting from AI-generated content
without citation is considered plagiarism.
By submitting this assignment to the subject lecturer through Blackboard, you hereby declare that the work
in this assignment is completely your own work. No part of this assignment is taken from other people’s
work without giving them credit. All references have been clearly cited.
You understand that an infringement of this declaration leaves you subject to disciplinary actions such as
mark deduction, disqualification or even expulsion by the College.
Plagiarism will be penalized severely. Marks will be deducted for assignments that are plagiarized in whole
or in part, regardless of the sources.
SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 2 of 7
Instruction
You are required to submit a Python Notebook using the template provided (Assign_2_Template.ipynb)
showing all the answers and programs. Rename the file as instructed below.
Your Python Notebook file should contain your name, your student ID no, and class (201/202/203/204).
All submitted assessments will be evaluated with Python version 3.10 or above (the current python version
used in Google Colab). Your submitted assessments must run without errors on Google Colab. Code that
cannot execute will result in zero or low marks for the respective questions. When you finish the
assignment, you are advised to use the “Restart session and run all” functionality of Colab to check
whether all code can execute successfully.
Unless otherwise instructed, you MUST NOT import any modules in your submitted assessments.
You MUST NOT change the procedure name (include cases) and parameters required.
Items to be Submitted
1. Python Notebook: Rename the notebook to the format <name>_<student ID>_<class>.ipynb, e.g.,
ChanTaiMan_22001234A_201.ipynb.
To download the Python Notebook (.ipynb)
In Google Colab, File → Download → Download .ipynb
To submit the Notebook via Blackboard
Upon uploading the notebook to the submission page in Blackboard, make sure that you click the “Submit”
button, not “Save and Close”.
To validate the submitted file
After you have submitted the notebook to Blackboard, download the submitted notebook from Blackboard
and upload it back onto Colab to check that your submitted file can still run in Colab. To do so, in
Blackboard, go to the assignment submission page, click on “View Submission”, download the ipynb file,
and upload it to Colab for checking. (Some students have done the assignment properly, but submitted some
junk code onto Blackboard, due to mistakes in downloading from Colab and uploading to Blackboard.)
Attention:
While submitting the softcopies via Blackboard, a timestamp will be placed on the softcopies of your
assignment. There will be a sharp cut-off time at Blackboard, so late assignments will be recorded at
Blackboard. Softcopies submitted via email or other means will NOT be accepted unless the Blackboard is
not available. As many students will submit their assignments to Blackboard at around the deadline time, it
normally takes longer for uploading your assignment, so it is strongly suggested that you start submitting
earlier, say at least 45 minutes before the deadline. Marks will be deducted for late submission.
SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 3 of 7
Question 1
A linear queue is a linear data structures having two ends i.e. the front end and the rear end. The
operations in a queue are carried out in First In, First Out (FIFO) order. This means, we can only
add items to the rear end of the queue and delete items from its front end. Implementing a linear
queue in array brings the drawback of memory wastage. When the rear pointer reaches the end of
a queue, there might be a possibility that after a certain number of dequeue() operations, it will
create an empty space at the start of a queue.
To overcome this limitation, experts introduced the concept of circular queue. A circular queue,
or a Ring Buffer, is an extended version of a linear queue as it follows the FIFO principle with the
exception that it connects the last node of a queue to its first by forming a circular link.
Array implementation of linear queue or circular queue has another limitation that the size of the
queue is bounded by the underlying array. When a queue is full, no additional element can be
added.
In question 1, you are going to implement a circular queue in Python list that will automatically
double its capacity when it is full.
(a) Complete the class AutoGrowthCircularQueue and implement the methods:
isEmpty(), getFrontElement(), getRearElement(), enqueue(), and
dequeue() according to the comment described in the Assignment Template.
(b) Run the testing code provided in the Assignment Template. It should produce the following
outputs (excluding the line numbers). Do not alter the testing code.
SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 4 of 7
1. Is Empty: True
2. Is Empty: False
3. Get: 2
4. Is Empty: True
5. Front element: 3
6. Rear element: 1
7. Queue size: 5/8
8. 3
9. String node 4
10. 1
11. 5
12. 6
Question 2
In Question 2, you will build a data structure for storing information of a student and learn how to
validate an input data against a predefined pattern.
(a) Write a class Student with the following specification:
1) The constructor takes two inputs: name (type str) and studentid (type str).
Validate their types. Raise an error and stop the program if the input type is invalid.
2) Validate the input studentid using the Boolean value “re.fullmatch('[0-
9]{8}A', studentid) is None” (a True value designates a mismatch). It
checks whether the input has 8 digits followed by the character 'A'. You need to import
the re library. Raise an error and stop the program if the input is invalid.
3) Initialize an instance attribute name to the input name.
4) Initialize an instance attribute studentid to the input studentid.
5) Overload the __str__() method to facilitate the printing with print(). See lines 2
& 3 of the outputs below for the required format.
6) Overload the __eq__() method to facilitate the comparison of Student objects.
Students with the same studentid attributes are deemed equal.
(b) Run the testing code provided in the Assignment Template. It should produce the following
outputs (excluding the line numbers). Do not alter the testing code.
1. Invalid student id 2224564
2. Name: Calvin Weign, ID: 22123456A
3. Name: Cola Coke, ID: 22003276A
4. False
5. True
6. Invalid data type!
SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 5 of 7
Question 3
In question 3, you will construct a Class Course to hold information about a course, registered
students, and students in waiting queue in case if the course was full. You will need to use the class
constructed in question 1 and 2.
(a) Complete the class constructor with the instructions below:
1) The constructor takes three inputs: code (type str), title (type str), and size
(type int). Validate their types. Raise an error and stop the program if the input type is
invalid.
2) Validate the input code using the Boolean value “re.fullmatch('[A-Z]{4}[0-
9]{4}', code) is None” (a True value designates a mismatch). The code should
starts with 4 upper case letters, then followed by 4 digits. Raise an error and stop the
program if the input type is invalid.
3) Initialize an instance attribute code to the input code.
4) Initialize an instance attribute title to the input title.
5) Initialize an instance attribute maxSize to the input size.
6) Initialize an instance attribute size to 0, i.e. the course contains no students at the
beginning.
7) Initialize an instance attribute BST to None. Binary search tree (BST) is used to stores
the registered students.
8) Initialize an instance attribute queue to an AutoGrowthCircularQueue. This
attribute is used to store students waiting for registration when course is full.
(b) Override __eq__() method to facilitate the comparison of Course objects. Courses with
the same code attributes are deemed equal.
(c) Write a method addStudent() with the specifications below:
1) Take one input student (type Student). Validate its type. Raise an error and stop
the program if the input type is invalid.
2) Print a message if the student was already registered, i.e. the student is in the BST
attribute and end the method. See line 11 below for the required format of the message.
3) If the course is not full, insert the student into the BST as the data field of a
BSTNode (the class BSTNode is provided in the Assignment Template; do not change
the code of the BSTNode class and do not use other implementations of BSTs). The key
field of the BSTNode is the studentid of the student. Increment the size attribute
and print a message for successful registration. See line 8 for the required format of the
message.
4) If the course is full, put the student into the queue attribute and print a message for
putting the student into waiting queue. See line 12 for the required format of the
message.
SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 6 of 7
(d) Write a method removeStudent() with the specifications below:
1) Take one input student (type Student). Validate its type. Raise an error and stop
the program if the input type is invalid.
2) Check if the student was registered or not. Print a message if the student was not
registered. See line 9 for the required format of the message.
3) If the student was registered, remove the student from the BST by calling
self.BST = self.BST.remove(self.BST, student.studentid).
Decrease the size attribute. Print a message according to line 13 for the required format.
4) If the course is not full and if there is other student waiting in the queue, remove a
student from the queue and add him to the course by calling the addStudent()
method.
(e) Run the testing code provided in the Assignment Template. It should produce the following
outputs (excluding the line numbers). Do not alter the testing code.
1. Invalid input type
2. Invalid course code abc1234
3. False
4. True
5.
6. Invalid input type
7. Invalid input type
8. Register Calvin Weign 22123456A successful.
9. Cola Coke 22003276A was not registered.
10. Register Cola Coke 22003276A successful.
11. Calvin Weign 22123456A has already registered.
12. Course full. Put Rain Man 22435638A in waiting queue.
13. Remove Calvin Weign 22123456A successful.
14. Register Rain Man 22435638A successful.
Question 4
In question 4, you will build a class CourseRegistry that store all the courses in a school. The
class will use hash table (backed by Python list) with separate chaining. Python built-in function
hash() is used to calculate hash code of a course using the course code as key. The calculated
hash code will then map to corresponding index position of the hash table using a modulo operator.
The constructor is provided in the Assignment Template.
(a) Method insert() is used to add a course into course registry. Complete the method with
the specifications below:
1) Take one input course (type Course). Validate its type. Raise an error and stop the
program if the input type is invalid.
2) Create a LLNode object with course.code as key and course as value (the class
LLNode is provided in the Assignment Template; do not change the code of the LLNode
class and do not use other implementations of linked lists).
SEHH2239 Data Structures
SEHH2239 – Assignment 2 Page 7 of 7
3) Determine the hash table index by calling hash(course.code) %
self.capacity and insert the LLNode object to the front of the linked list.
4) Increment the size attribute by 1.
(b) Method search() is used to find and return a course from the course registry. Complete the
method with the specifications below:
1) Take one input code (type str). Validate its type. Raise an error and stop the program
if the input type is invalid.
2) Determine the hash table index by calling hash(code) % self.capacity.
3) Search along the linked list to see if any matching LLNode with key equals to the
inputted code. If found, return the value attribute of the LLNode. Otherwise, return
None.
(c) Run the testing code provided in the Assignment Template. It should produce the following
outputs (excluding the line numbers). Do not alter the testing code.
1. None
2. Data Structures
3.
4. Register Chan TM 22061762A successful.
5. Register CHOW MP 22167034A successful.
6. Register LAM CS 22118617A successful.
7. Register LEUNG WA 22018089A successful.
8. Register LI CC 22134887A successful.
9. Course full. Put LIU MK 22052452A in waiting queue.
10. Course full. Put NG KY 22018110A in waiting queue.
11. Course full. Put SHEK CL 22161668A in waiting queue.
12. Course full. Put TSE David 22158990A in waiting queue.
13. Course full. Put WONG KM 22153656A in waiting queue.
14.
15. Remove CHOW MP 22167034A successful.
16. Register LIU MK 22052452A successful.
17.
18. Course code: SEHH2239
19. Course title: Data Structures
20. Course size: 5/5
21. Registered students:
22. 22018089A Name: LEUNG WA, ID: 22018089A
23. 22052452A Name: LIU MK, ID: 22052452A
24. 22061762A Name: Chan TM, ID: 22061762A
25. 22118617A Name: LAM CS, ID: 22118617A
26. 22134887A Name: LI CC, ID: 22134887A
27. Students in queue:
28. Queue size: 4/8
29. Name: NG KY, ID: 22018110A
30. Name: SHEK CL, ID: 22161668A
31. Name: TSE David, ID: 22158990A
32. Name: WONG KM, ID: 22153656A
- END of Assignment 2 -

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
















 

標簽:

掃一掃在手機打開當(dāng)前頁
  • 上一篇:CS 211編程代做、代寫c/c++,Java程序
  • 下一篇:MANA 420代做、代寫Java/Python編程語言
  • 無相關(guān)信息
    昆明生活資訊

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

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    在线中文字幕av| 女人天堂在线| 在线影视一区| 欧美动物xxx| 高清成人在线| 国产成人免费9x9x人网站视频 | 亚洲精品综合在线| 日韩—二三区免费观看av| 国产原创一区| 成人av色网站| 国产免费专区| 日本一区二区三区国色天香 | 国产成人亚洲综合a∨婷婷| 日本国产精品| 日韩经典一区| 羞羞视频在线观看一区二区| 亚洲国产成人va在线观看天堂| 国产婷婷色一区二区三区| 国产999精品久久久久久| 亚洲国产wwwccc36天堂| 在线播放av片| 欧美一级全黄| 亚洲人成网站精品片在线观看| 亚洲一区二区av在线| 欧美无人高清视频在线观看| 亚洲午夜激情av| 国产精品久久久久9999吃药| 国产精品国模大尺度视频| 中文字幕国产一区| 欧美午夜精品久久久久久久| 蜜桃精品视频在线| 成人免费a**址| 啪啪av大全导航福利综合导航| 第一会所亚洲原创| 亚洲国产日韩欧美一区二区三区| 美女国产精品| 日韩国产精品91| 26uuuu精品一区二区| www.色在线| 国产成人在线中文字幕| 欧美亚洲国产激情| 青草av.久久免费一区| 亚洲欧美日本在线| 日韩欧美国产成人| 91福利在线播放| 色婷婷综合五月| 亚洲国产精品一区二区www | 香蒸焦蕉伊在线| 色老板在线视频| 正在播放亚洲一区| 在线观看一区二区精品视频| av福利导福航大全在线播放| 99热这里只有精品首页| 欧美日韩一区二区三区四区不卡 | 超碰caoporn久久| 国产亚洲一二三区| 亚洲韩国一区二区三区| 亚洲四虎av| 国产精品66| 91麻豆国产香蕉久久精品| 久久国产情侣| 欧美激情91| 亚洲激情五月婷婷| 国产精品久久亚洲不卡| 国产欧美日韩综合一区在线播放| 亚洲在线国产日韩欧美| 中文字幕成人av| 欧美日韩久久一区| 久久综合之合合综合久久| 浪潮av一区| 亚洲天堂日韩在线| youjizz亚洲| 亚洲区综合中文字幕日日| 欧美在线不卡| 国产h色视频在线观看| av黄色在线| 成人豆花视频| 99国产欧美另类久久久精品| 精品粉嫩aⅴ一区二区三区四区| 国产精品美女久久久久久久久久久 | 精品久久久久久中文字幕大豆网| 奇米亚洲欧美| 亚洲国产乱码最新视频| 91精品一久久香蕉国产线看观看| 肉肉av福利一精品导航| 日韩影视高清在线观看| 美国一区二区三区在线播放| 欧美日韩免费一区二区三区| 国内精品久久久久久野外| 最新亚洲视频| 欧美福利视频导航| 秋霞午夜在线观看| 99成人超碰| ㊣最新国产の精品bt伙计久久| 亚洲精品传媒| 亚洲综合欧美| 亚洲欧美国产高清| 美乳中文字幕| 天天综合亚洲| 国产精品久久久久影视| 精品久久久久久久久国产字幕| 欧美电影免费观看| 国产精品视频观看| 宅男网站在线免费观看| 久久综合九色综合97婷婷女人| 亚洲精品aa| 伊人久久成人| 丝袜美腿av在线| 一道本成人在线| 国内在线观看一区二区三区| 欧美一区二区三区免费视频| 欧美午夜美女看片| 午夜在线视频| 欧美激情一区不卡| caoporn免费在线视频| 国产欧美高清| 亚洲精品少妇久久久久久 | 久9re热视频这里只有精品| 国产偷国产偷精品高清尤物| dy888亚洲精品一区二区三区| 欧美激情一区二区三区在线| 精品中文视频| 国产欧美一区二区精品婷婷| 91在线超碰| 国产精品毛片无遮挡高清| 免费不卡视频| 麻豆国产精品| 精品一区免费av| 自拍视频在线网| 成人av免费网站| 激情小说亚洲| 日韩欧美在线123| 日韩av电影天堂| 在线看小视频| 日韩中文字幕1| 日韩欧美国产成人一区二区| 久久国产精品亚洲人一区二区三区 | 黄视频免费在线看| 欧美色爱综合网| 国产成人在线免费| 韩国女主播一区二区| 国产精品欧美久久久久一区二区| 国产ktv在线视频| 欧美日韩在线播| 午夜亚洲性色福利视频| 色琪琪一区二区三区亚洲区| 欧美xxx在线观看| 伊人资源视频在线| 亚洲精品v日韩精品| 午夜精品福利影院| 国产wwww| 91丝袜美腿高跟国产极品老师 | 精品少妇一区二区三区在线播放| 久久美女高清视频| 黄色成人精品网站| 婷婷精品在线观看| 人在线成免费视频| 激情视频免费| 亚洲免费在线观看视频| 一区在线播放| 永久www成人看片| 一区二区激情小说| 国产精品mv在线观看| 欧洲毛片在线| 亚洲成av人综合在线观看| 亚洲成人日韩| 国产区av在线| 亚洲在线观看免费视频| 欧美电影免费播放| 波多野结衣中文在线| 三上悠亚一区二区三区| 欧洲精品中文字幕| 亚洲综合日本| 午夜欧洲一区| 男人的天堂在线视频免费观看| 欧美一区二区三区公司| 91丨porny丨国产入口| 免费网站在线观看人| 欧美日韩黄色一区二区| 一区二区不卡在线播放 | av福利在线导航| 91精品国产色综合久久不卡电影| 久久国产视频网| 国产精品久久久久久久久久辛辛 | 亚洲高清免费观看高清完整版在线观看| caoporen国产精品视频| 日韩伦理视频| h网站视频在线观看| 精品国产污污免费网站入口 | 午夜电影一区二区三区| 久久精品国产亚洲一区二区三区| 欧美在线91| 成人婷婷网色偷偷亚洲男人的天堂| 乱人伦视频在线| 一级片免费在线| 国产精品成人一区二区艾草| 国产成人精品三级| 狠狠色狠狠色综合日日91app| 伊人天天综合| 日韩理论在线|