document.write( "Question 1165767: Write a program that \r
\n" );
document.write( "\n" );
document.write( "a. Generates 50,000 random numbers and puts them in an array.\r
\n" );
document.write( "\n" );
document.write( "b. 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.\r
\n" );
document.write( "\n" );
document.write( "c. 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?\r
\n" );
document.write( "\n" );
document.write( "d. Ask the user for a number between 0 and 20,000,000 and search for it in your sorted array using a binary search.\r
\n" );
document.write( "\n" );
document.write( "Hint: To generate random numbers you need to include this module:
\n" );
document.write( "import random
\n" );
document.write( "To get a random number w : \r
\n" );
document.write( "\n" );
document.write( "w = random.randint(0,20000000)
\n" );
document.write( "This will give w a random value between 0 and 20,000,000
\n" );
document.write( " \n" );
document.write( "
Algebra.Com's Answer #790219 by ikleyn(52781)![]() ![]() You can put this solution on YOUR website! .\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "At this forum, we do not accept requests on creating/writing computer codes/programs.\r \n" ); document.write( " \n" ); document.write( " \n" ); document.write( "\n" ); document.write( " \n" ); document.write( " |