CSD201_-_T1_-_SU_2024_2172.webp
T

CSD201_-_T1_-_SU_2024_2172.webp

void t2() - Perform pre-order traversal for the of the BST, but display to file f2.txt nodes with color<8 only.
Hint: Copy the function preOrder(...) to function preOrder2(...) and modify it.
The expected output in the file f2.txt should be the following (line 1: Breadth first traversal, line 2:pre-order traversal)
(P,7,9) (D,4,3) (G,9,6) (L,1,8) (B,6,4) (Χ,8,9)
2
(D,4,3) (B,6,4) (G,9,6)
void f3() - Perform a new traversal method to visit all nodes in the BST with the constraint: visit the nodes in the descending order of weight. The expected output in the file f3.txt should be the following:
(T,8,-5) (M,7,2) (P,6,3) (R,5,9) (S,4,1) (L,2,5)
Zoom

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

Thông tin

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

Image metadata

Filename
CSD201_-_T1_-_SU_2024_2172.webp
File size
107.5 KB
Dimensions
916px x 472px

Share this media

Back
Bên trên Bottom