CSD201_-_FA_2024_-_PE_-_s_-_7_2876.webp
Lan Anh1

CSD201_-_FA_2024_-_PE_-_s_-_7_2876.webp

  • Media owner Lan Anh1
  • Ngày thêm
(E,9,4)(C,8,2) (D,6,1) (E,9,4) (F,2,-1) (G,7,3) (1,1,7) (K,-1,5) (J,3,9) (M,4,6) (L,5,10)
2
void f4() - Suppose p is the 3rd node having right-child when performing the pre-order traversal of the tree from the root. Rotate p to left. Output in the file f4.txt must be the following:
(C,8,2) (D,6,1) (E,9,4) (F,2,-1) (G,7,3) (H,10,8) (1,1,7) (J,3,9) (K,-1,5) (L,5,10) (M,4,6)
(C,8,2) (D,6,1) (E,9,4) (F,2,-1) (G,7,3) (J,3,9) (H,10,8) (L,5,10) (1,1,7) (Κ,-1,5) (Μ,4,6)
Question 3: (2 marks)
In this question you should complete some methods in Graph.java file.
The class Graph is the implementation of a graph. The following methods should be completed:
void f1() - Perform depth-first traversal (to the file f1.txt) from the vertex i=4 (the vertex E) but display 6 vertices with their degrees from the 2nd vertex to the 7th vertex only. Hint: copy depth(...) to depth2(...) and modify the latter one. The array int deg[] already declared in the class
Close
+ 100%
Zoom
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
CSD201_-_FA_2024_-_PE_-_s_-_7_2876.webp
File size
193.5 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom