Write c++ code Create a BST where each node stores the rollNumber and marks of a student. Your task is to provide the implementation of following methods. constructor insertRecord() function updateRecord() function countOfPassedStudents() showData() function inside main() function, create an object of BST class. Insert the following data and create the BST according to the marks. ● 19L-1941, 71 should be the root node
Write c++ code
Create a BST where each node stores the rollNumber and marks of a student. Your task is to
provide the implementation of following methods.
constructor
insertRecord() function
updateRecord() function
countOfPassedStudents()
showData() function
inside main() function, create an object of BST class.
Insert the following data and create the BST according to the marks.
● 19L-1941, 71 should be the root node
● 19L-1942, 62
● 19L-1943, 67
● 19L-1944, 54
● 19L-1945, 58
● 19L-1946, 45
● 19L-1947, 29
● 19L-1948, 76
● 19L-1949, 81
● 19L-1950, 92
Update the data of following record
● Marks of 19L-1944 are 54. Update the marks to 47
● Marks of 19L-1949 are 81. Update the marks to 85
Call the countOfPassedStudents(). You can either display the count in the same function or
return the value to main function.
Call the showData() function to display all the records of BST in preorder traversal.
Note: It is not mandatory to create a template class
Step by step
Solved in 2 steps