1762599805457.webp
SN1

1762599805457.webp

  • Media owner SN1
  • Ngày thêm
• The reverse traversing of the BST tree which node's value are greater than or equal to 7 is: 12, 10,
9, 7.
6
10
12
Figure 1. The BST that created by inserting 7, 9, 4, 1, 12, 6, 10 one by one
The input: are stored in the reverse Traversing_input.txt text file:
⚫ The first line contains a positive integer N (1 ≤ N ≤ 100) which is the number of integer values
to insert into the BST.
• The second line containing N integers that will be inserted into the BST one by one, each
number separated by at least one space.
The third line containing a positive integer V. The value of V is always guaranteed to have
results when traversing the tree.
The output: the results need to be saved to the reverse Traversing_output.txt text file:
• One line contains the list of numbers representing the reverse traversing of the BST which
node's value must be greater than or equal to V. Each number separated by one comma.
Sample Input 1
7
7941 12 6 10
7
Sample Output 1
12,10,9,7
Sample Input 2
10
78 21 36 18 30 91 74 55 98 100
Sample Output 2
100,98,91
90
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom