Question: Write a procedure insert that can be used to add a node to a binary search tree. insert should take three parameters: the integer value

Write a procedure insert that can be used to add a node to a binary search tree. insert should take three parameters: the integer value to be added to the tree, the address of a memory word that contains the address of the root of the tree, and the address of a memory word containing the address of the first node in the free list. If there is already a node in the tree that contains that integer value, the tree should not be changed. Otherwise, a node should be unlinked from your free list (using alloc), the integer value to be added to the tree should be stored in that node, and the node linked into the tree in a position that maintains the binary search tree ordering.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!