Question: RUN THE FOLLOWING CODE CELL to create class bt_node I pass TEST PREPARATION Run the following cells to create the nodes and trees that will


![that will be used in the test cases further below In [14]:](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f031b00b8a8_39166f031afa8a85.jpg)

![Engtish atphabet \# import string for cur_letter in string.ascii_uppercase: \# globals()[cur_letter] =](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f031b10ca16_39266f031b0a14cb.jpg)
![bt_node( cur_letter) In [15]: \# Buitd a tree (Tree \#1) with Mode](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f031b18b700_39366f031b13e287.jpg)

RUN THE FOLLOWING CODE CELL to create class bt_node I pass TEST PREPARATION Run the following cells to create the nodes and trees that will be used in the test cases further below In [14]: \# Create a bunch of nodes naned ofter upppercase tetters of the Engtish atphabet \# import string for cur_letter in string.ascii_uppercase: \# globals()[cur_letter] = bt_node( cur_letter) In [15]: \# Buitd a tree (Tree \#1) with Mode A as the root \# A. left =B A. right =C B. left =D D. left =E D. right =F F.right =G G. left =H G.right =I C. left =] c.right =N J. left =K J.right =L K.left=NK.right=0o.right=PP.right=R \# Buitd a second tree (Tree \#2) with Mode s as the root \# S.left =T T.left =U U.left =V V.left =W W.right =X X. right =Y Y.right =Z These two binary trees can be represented pictorially as follows. The depth of the first tree with node A as root is 6 . The depth of the second tree with node 5 as root is 7 . By definition, root nodes are at depth 0 . Question 140 points 25 mins i^ In this question you will implement a Python function that will return a list of all leaf nodes in a given binary tree. - Implement get_leaf_nodes_r( root) that strictly uses recursiong to accomplish this task This function should return an empty list if the provided treeode does not have any children. You are to write this function from scratch. This means your code should contain no import statements! WARNING If you write this function disregarding the strict specifications mentioned above, you will not get any credit for your solution, even if it happens to "work." YOU MUST WRITE YOUR CODE IN THE FOLLOWING CODE CELL In [ ]: In [ ]: TESTS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
