Construct and manage a Binary Search Tree (BST) to store employee information based on the ID field, including employee data as follows:
ID
Name
Department
Seniority
104
Nam Nguyen
HR IT
5
102
Linh Phan
1
103
Minh Le
Finance
3
101
Ngoc Nguyen
IT
6
107
Huong Pham Tuan Tran
Finance
3
106
Finance
2
108
Hang Le
IT
4
105
Hung Nguyen
IT
5
1. Define the Employee class: (0.5 points)
Store the employee's information, including the following fields:
Employee ID (id - integer)
Employee Name (name - string)Department (department - string)
Seniority (seniority - integer)
2. Define the Node class: (0.5 points)
Each node contains an Employee object and necessary fields for tree operations.
3. Define the BST class:
3.1. The insert method to insert an employee into the BST based on the employee's ID. (1
point)
3.2. The inOrder method to traverse the BST using in-order traversal. (1 point)
3.3. The search method to search for an employee by their name. (1 point)
+ 100%
Zoom
Close