Question: code in python! Write a program that Generates 50,000 random numbers and puts them in an array. Sorts the numbers using any sorting technique (Selection

code in python!

Write a program that

  1. Generates 50,000 random numbers and puts them in an array.
  2. Sorts the numbers using any sorting technique (Selection sort is fine, but you can try another one). This should take a few minutes to run.
  3. Ask the user for a number between 0 and 20,000,000 and search for it in your sorted array using a simple linear search. Is this a good idea?
  4. Ask the user for a number between 0 and 20,000,000 and search for it in your sorted array using a binary search.

Hint: To generate random numbers you need to include this module:

import random

To get a random number w :

w = random.randint(0,20000000)

This will give w a random value between 0 and 20,000,000

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!