Question: Using the functions at the bottom please help out . Using the same method headers shown below. Using these functions 1. Write the function is_root_leaf_bst

Using the functions at the bottom please help out . Using the same method headers shown below.

Using the functions at the bottom please help out . Using thesame method headers shown below. Using these functions 1. Write the functionis_root_leaf_bst (T) that receives a reference to a binary search tree Tand determines if the root of T is also a leaf. 2. Using these functions

1. Write the function is_root_leaf_bst (T) that receives a reference to a binary search tree T and determines if the root of T is also a leaf. 2. Write the function is_root_leaf_btree( T ) that receives a reference to a B-Tree tree T and determines if the root of T is also a leaf. 3. Write the function nodes_with_one_child(T) that receives a reference to a binary search tree T and returns a list containing the keys in the tree that are stored in nodes that have one child, sorted in ascending order. 4. Write the function nodes_with_n_items (T,n) that receives a reference to a B-Tree T and an integer n and returns a list containing references to the nodes in the tree that have n items. 5. Write the function sibling (T,k) that receives a binary search tree T and an integer k and returns the key stored in the sibling of the node that stores k or None if k is not in the tree or if the node where k is stored has no sibling. 6. Write the function smallest_in-path (T,k) that receives a reference to a B-tree T and an integer k and returns a list of integers containing the smallest item in each of the nodes in the path taken from the root to the node where k is stored. You may assume that k is in the tree. T. 1. Write the function is_root_leaf_bst (T) that receives a reference to a binary search tree T and determines if the root of T is also a leaf. 2. Write the function is_root_leaf_btree( T ) that receives a reference to a B-Tree tree T and determines if the root of T is also a leaf. 3. Write the function nodes_with_one_child(T) that receives a reference to a binary search tree T and returns a list containing the keys in the tree that are stored in nodes that have one child, sorted in ascending order. 4. Write the function nodes_with_n_items (T,n) that receives a reference to a B-Tree T and an integer n and returns a list containing references to the nodes in the tree that have n items. 5. Write the function sibling (T,k) that receives a binary search tree T and an integer k and returns the key stored in the sibling of the node that stores k or None if k is not in the tree or if the node where k is stored has no sibling. 6. Write the function smallest_in-path (T,k) that receives a reference to a B-tree T and an integer k and returns a list of integers containing the smallest item in each of the nodes in the path taken from the root to the node where k is stored. You may assume that k is in the tree. T

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!