Forum Stats

  • 3,852,007 Users
  • 2,264,055 Discussions


Kindly answer the Question below

User_D399L Member Posts: 1 Green Ribbon

Construct a binary search tree (BST) whose number of nodes is per the formula below:

# nodes in the binary search tree = 13 + (last two digits of your J# MOD 7)=J00123112

For example, if a student's J# is J00123123, then the (last two digits of the J# MOD 7) is 23 MOD 7 = 2

Accordingly, the # nodes in the binary search tree is 13 + 2 = 15.

Per the above formula, the # nodes in the BST for any student can range from 13 to 19.

Show the construction of the BST level by level, with the range of node indexes in each sub tree and the indexes for each node, as shown in the lecture slides (Example 2).

Also, show the final BST with the node indexes written outside the circles.