[1] Write a function random_list(range_max, size) that returns a list of size random numbers in range(1, range_max). Fo

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

[1] Write a function random_list(range_max, size) that returns a list of size random numbers in range(1, range_max). Fo

Post by answerhappygod »

[1] Write a function random_list(range_max, size)that returns a list of size random numbers in range(1,range_max). For this assignment, (a) do not sort the random listupfront, and (b) do allow duplicates
[2] After generating the random list, you will need tomake a copy of it for each algorithm. Otherwise, once you sort itfor one algorithm, it is already sorted! For how to copy an array,see https://docs.python.org/3/library/copy.html
[3] Write or call a function that will confirm that thelist has been sorted. If it detects an error, make sure to print itvery conspicuously (or throw an exception) so that the error can beresearched.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply