CSD201_-_PE_-_SP_2025_-_Block_5_3859.webp
Lucy_boy1

CSD201_-_PE_-_SP_2025_-_Block_5_3859.webp

☑Kizspy.me

void f3()-Suppose the list is not empty. Find the (first) node having maximum depth and change
its' place to XX. Output in the file f3.txt must be the following:
(C,8,6) (D,3,5) (E,9,2) (F,5,8) (G,9,7) (H,6,8) (1,7,3)
(C,8,6) (D,3,5) (XX,9,2) (F,5,8) (G,9,7) (H,6,8) (1,7,3)

void f4()-Suppose the list contains at least 7 elements. Sort the 4 elements from position 2 to
position 5 (head's position is 0) ascendingly by depth. The content of the output file f4.txt must
be the following:
(C,7,9) (D,6,7) (E,5,6) (F,4,11) (1,10,5) (J,3,4) (K,2,3)
(C,7,9) (D,6,7) (J,3,4) (F,4,11) (E,5,6) (1,10,5) (K,2,3)
Quesion 2: (4 marks)
In this question you should complete some methods in BSTree.java file.
The class Brick with 3 data members: owner, color and size is given and you do not need to edit it. The
BSTree class is a binary search tree of Brick objects. The variable color is the key of the tree, thus it must
be unique. The following methods should be completed:
Zoom

void insert(String xOwner, int xColor, int xSize) - check if xOwner.charAt(0) == 'B' then do nothing,
otherwise insert new Brick with owner=xOwner, color-xColor, size=xSize to the tree (color and
size can get arbitrary, even negative values).
+ 100%
Close
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom