狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线

代做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
















 

標簽:

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

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

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

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

    狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线
  • <dl id="akume"></dl>
  • <noscript id="akume"><object id="akume"></object></noscript>
  • <nav id="akume"><dl id="akume"></dl></nav>
  • <rt id="akume"></rt>
    <dl id="akume"><acronym id="akume"></acronym></dl><dl id="akume"><xmp id="akume"></xmp></dl>
    欧美这里只有精品| 少妇人妻互换不带套| 自拍偷拍一区二区三区四区| 日韩一级免费看| 男女日批视频在线观看| 欧美激情亚洲天堂| 人人干视频在线| 亚洲中文字幕久久精品无码喷水| 丰满少妇被猛烈进入高清播放| 狠狠干 狠狠操| 黄色片一级视频| av网站在线不卡| 日本在线观看视频一区| 久久久精品视频国产| 久久福利一区二区| 少妇无码av无码专区在线观看| 日韩免费视频播放| 91香蕉视频导航| 天天爱天天做天天操| 成人在线视频一区二区三区| 国产3p露脸普通话对白| www.日日操| 毛片毛片毛片毛片毛| 蜜臀av色欲a片无码精品一区| 国产精品97在线| 99国产精品久久久久久| 女女百合国产免费网站| 欧美爱爱视频免费看| 男女视频在线看| 中文字幕色呦呦| 熟女少妇精品一区二区| 日韩video| 黄色高清无遮挡| 亚洲黄色网址在线观看| 凹凸国产熟女精品视频| 国产又爽又黄ai换脸| 欧美日韩一道本| 亚洲高清av一区二区三区| 97在线免费公开视频| www.桃色.com| 热久久精品免费视频| 蜜臀精品一区二区| 91丨九色丨蝌蚪| www.亚洲天堂网| 国产91porn| 91精品999| 不要播放器的av网站| 男的插女的下面视频| 久久出品必属精品| 午夜久久久精品| 日韩在线xxx| 91九色丨porny丨国产jk| 成人性生交视频免费观看| 国产91对白刺激露脸在线观看| 丰满人妻一区二区三区53号| 日韩不卡一二三| 男人女人黄一级| 欧美日韩在线中文| 奇米影视亚洲色图| 97免费视频观看| 国产欧美精品aaaaaa片| 艳母动漫在线观看| 热久久最新地址| 性久久久久久久久久久久久久| 精品综合久久久久| 亚洲18在线看污www麻豆| 婷婷六月天在线| 婷婷免费在线观看| 91看片破解版| 在线播放黄色av| 三级黄色片免费看| 艳母动漫在线观看| 成人免费性视频| 亚洲 高清 成人 动漫| 国产真实乱子伦| 亚洲视频在线观看一区二区三区| 国产视频一区二区三区在线播放 | 久热免费在线观看| 国产一级片黄色| 一女二男3p波多野结衣| 6080国产精品| 99久久免费观看| 日韩视频在线免费看| 成人黄色一区二区| 国产农村妇女精品久久| 成人在线免费观看网址| 国产日韩av网站| caopor在线视频| 国产999免费视频| 国产特级黄色大片| 亚洲人视频在线| 美女黄色免费看| 中文字幕有码av| aaa免费在线观看| 国产女女做受ⅹxx高潮| 不卡中文字幕在线观看| 国产高清www| www.夜夜爽| 2018国产在线| 精品亚洲视频在线| 日本韩国欧美在线观看| 日韩在线不卡一区| 噜噜噜久久亚洲精品国产品麻豆 | 男人操女人免费软件| 加勒比av中文字幕| 国产精品无码专区av在线播放| 99999精品| 国产精品99久久免费黑人人妻| 在线免费黄色小视频| 免费高清在线观看免费| 男人的天堂视频在线| 成年网站免费在线观看| 欧美黄色免费影院| 国产天堂视频在线观看| 天天久久综合网| 一级在线免费视频| 国产日产欧美视频| 夜夜添无码一区二区三区| 日本一本在线视频| 亚洲免费999| av五月天在线| 亚洲 中文字幕 日韩 无码| 少妇高潮喷水在线观看| 操人视频免费看| 天堂中文av在线| av亚洲天堂网| 天天视频天天爽| 亚洲污视频在线观看| 人人干人人视频| 成人亚洲视频在线观看| 免费无码av片在线观看| 免费无码av片在线观看| 波多野结衣家庭教师在线| 中国丰满熟妇xxxx性| 黄色片网址在线观看| cao在线观看| 欧美色图色综合| 日韩av在线综合| 三上悠亚在线一区二区| 亚洲男人天堂2021| 成人污网站在线观看| 成人短视频在线观看免费| 国产人妻人伦精品| 毛片在线播放视频| 99久久激情视频| 在线播放av中文字幕| 看全色黄大色大片| 国产精品国产亚洲精品看不卡| 黄色影院一级片| 久久撸在线视频| 久久免费一级片| 高清在线观看免费| 女同激情久久av久久| 欧美日韩在线免费观看视频| 波多野结衣av一区二区全免费观看| 麻豆传媒网站在线观看| 青青视频在线播放| 福利视频999| 免费国产黄色网址| xxww在线观看| a级黄色一级片| 中文字幕在线视频一区二区三区| 中文精品无码中文字幕无码专区| 黄色网页免费在线观看| 成人日韩在线视频| 男女视频网站在线观看| 不卡中文字幕在线观看| 黄页免费在线观看视频| 日韩av.com| 欧美精品第三页| 毛片av在线播放| 九九九九九国产| 国产男女在线观看| 国产一二三四区在线观看| 欧美少妇性生活视频| 久久久久久久久网| 九九热精品在线播放| 尤物av无码色av无码| 影音先锋成人资源网站| 五月激情婷婷在线| 黄色高清无遮挡| 国产综合av在线| 国产成人一区二区三区别| 五月天激情播播| 在线观看免费黄网站| 美女福利视频在线| 欧美亚洲精品一区二区| 少妇久久久久久被弄到高潮| 欧美成人乱码一二三四区免费| 亚洲精品无码久久久久久| 国产一区二区三区播放| 国产高清精品软男同| 玖玖爱视频在线| 男人的天堂最新网址| 欧美精品久久久久久久久25p| 日本一本二本在线观看| 国产a级一级片| 男人操女人免费软件| wwwxxx黄色片| 国产精品亚洲αv天堂无码|