Question: Design a program to generate a specified quantity of integers (minimum 1000 integers). Use rand function to generate integers between 1 and 10000. Note
Design a program to generate a specified quantity of integers (minimum 1000 integers). Use rand function to generate integers between 1 and 10000. Note that these random numbers can contain duplicates. Store this collection of integers in the various data structures (List, Dictionaries, Binary tree, Binary search tree, Linked List) then perform the following: 1. Print all the elements. Measure empirically the time it takes to print all the elements for all the data structures. Tabulate your results - Table-1. 2. A series of retrievals of random values (use rand function) in the collection and measure empirically the time it takes to do the retrievals in each of the structures. You should run this program 5 times. Tabulate your results - Table-2. 3. Generate a random number and perform insertion operation on all the data structures. You should run this program 5 times. Tabulate your results - Table-3. 4. Generate a random number and perform deletion operation on all the data structures. You should run this program 5 times. Tabulate your sults - Table-4.
Step by Step Solution
3.49 Rating (159 Votes )
There are 3 Steps involved in it
To achieve the tasks outlined you can use a programming language like Python Below is a simple example using Python with the time module for measuring the execution time Note that Python does not have ... View full answer
Get step-by-step solutions from verified subject matter experts
