Question: use python to write it. Problem 3. (20 points) Use selection (i.e. average runtime of O(n)) to find the ith smallest number. The first number

 use python to write it. Problem 3. (20 points) Use selection

use python to write it.

Problem 3. (20 points) Use selection (i.e. average runtime of O(n)) to find the ith smallest number. The first number in the text file (on its own line) will be i. The second line will the the array of number which you want to find the ith smallest. You may assume the array contains only integers. Sample output.txt (single number only): 4 Sample input.txt (first line will be the integer i, second line will be array with spaces between elements (no space after last)): 7 4 5 8 2 4 7 5 0 8 2 3 9 23 48 -12 49

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!