CSD201_-_T1_-_SU_2024_2172.webp
T

CSD201_-_T1_-_SU_2024_2172.webp

void insert(String xPlace, int xWeight, int xColor)
void f1() Your task is to add statements in the insert(...) method so that any node with xPlace.charAt(0) == 'F' is not inserted to the tree. The expected output in file f1.txt should be as follows (line 1: Breadth first traversal, line 2: In-order traversal)
Χ,5,2) (Ν,3,6) (M,9,5) (P,1,3) (R,4,8) (Q,8,7) (L,7,6)(
(P,1,3) (N,3,6) (R,4,8) (X,5,2) (L,7,6) (Q,8,7) (M,9,5)
void f2() - 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)
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,404
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
118.1 KB
Dimensions
916px x 472px

Share this media

Back
Bên trên Bottom