Question: Please help me complete this python code. import random # 1. make list of numbers from to n1 # 2. randomly shuffle the list #
Please help me complete this python code.


import random \# 1. make list of numbers from to n1 \# 2. randomly shuffle the list \# 3. insert the random list elements in order into a tree. \# 4. return the height of the resulting ree. def run_single_experiment (n) : * your code here nums =[] for i in range (n) : nums. append (i) random. shuffle (nums) root = Node (nums [0]) for i in range (1,n) : root.insert (nums [i] ) return height (root) def run_multiple_trials( n, numTrials): lst_of_depths = [run_single_experiment (n) for j in range(numTrials)] return (sum(lst_of_depths)/len(lst_of_depths), lst_of_depths)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
