CSD203_-_PE_-_FA_2023_-_PV_941.webp
F

CSD203_-_PE_-_FA_2023_-_PV_941.webp

  • Media owner Falman97
  • Ngày thêm
SP005, Schweppes, Carton of 24 cans, 320ml, 220.000 2C017, Coca-Cola, Carton of 24 bottles, 600ml, 218.000
MD020, Mirinda, Carton of 24 bottles, 390ml, 175.000
Notes:
- Do not edit given statements in the main function
- You can create new functions if you see it is necessary.
- Carefully read the instructions in each question to best complete your the practical exam.
Question 2: (5 marks)
The given file Q2.py already contains statements to implement a simple program to monitor Watch objects using Binary Search Tree structure. You should write statements to the following functions:
f. f1(): Compute the height of given Binary Search Tree (BST).
Expected result:
3
g. f2(): Perform the Post-Order traverse on the BST, but ONLY visit nodes that has Watch's price lager than 3 and less than 8.
Expected result:
CT-BM7466-81H, Citizen, 40, 7.590 SK-SUR211P1, Seiko, 42, 3.690 SK-SUR263P1, Seiko, 41, 3.555 OR-FUNG800300, Orient, 40, 3.762
h. f3(): Insert into the current tree a new Watch which code = 'OR-FGW01006W0', make = 'Orient',size = 38, price = k, where k is height of the current tree before insertion.
+ 100%
Zoom

Close
Chưa có bình luận nào.

Thông tin

Category
CSD203
Thêm bởi
Falman97
Ngày thêm
Lượt xem
1,177
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD203_-_PE_-_FA_2023_-_PV_941.webp
File size
61 KB
Dimensions
1552px x 652px

Share this media

Back
Bên trên Bottom