CSD201_Fall-2023_HCM_Ca_2_1980.webp
Thanh Loan1

CSD201_Fall-2023_HCM_Ca_2_1980.webp

Content of the file f2.txt:(A,50,8) (Β,10,2) (C,4,5) (D,25,4) (J,19,3) (G,7,6) (1,20,7) (E,30,10) (F,14,9) (H,34,11)
(1,19,3) (1,20,7) (G,7,6) (C,4,5) (B,10,2) (F,14,9)
Void f30) - add age of all nodes have only one child to 3 (age=age+3).(Hint: such nodes will have either left child or right child.)
Output in the file f3.txt must be the following:
Content of the file f3.txt:
(Α,50,8) (Β,10,2) (E,30,10) (C,4,5) (F,14,9) (H,34,11) (D,25,4) (G,7,6) (J,19,3) (1,20,7)
(Α,50,8) (Β,13,2) (E,30,10) (C,4,5) (F,14,9) (H,34,11) (D,28,4) (G, 10,6) (J,19,3) (1,20,7)
FOOVERFLOWIGOM
Void f4()- Calculate height of last node in postOrder traversal from the root.(Hint: Calculate height of the node (height of a node is height of subtree with root is the node which we need to calculate height, assume that if there is only one node then height = 1).)
Output in the file f4.txt must be the following:
Content of the file f4.txt:
(A,50,8) (B,10,2) (C,4,5) (D,25,4) (J,19,3) (G,7,6) (1,20,7) (E,30,10) (F,14,9) (H,34,11)
5
Void f50)- Reset age of all nodes locate in left branch of 1st node in preOrder traversal
from root to zero(age=0).
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
CSD201_Fall-2023_HCM_Ca_2_1980.webp
File size
118.7 KB
Dimensions
1552px x 617px

Share this media

Back
Bên trên Bottom