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.

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

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

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!