Question: please answer completely :( Write at least one real-world example for each of the following complexity types: O(lg n), O(n), O(nlgn), O(2 n ). Now,

please answer completely :(

Write at least one real-world example for each of the following complexity types: O(lg n), O(n), O(nlgn), O(2n). Now, implement the above-mentioned examples in java and find the maximum n for which you were able to run the code in your computer. Also, write how much time it took by your computer to run that code in hrs:minutes: seconds. -

For example: your answer should be like this: Real world example for O(n2) is Bubble sort. Now implement actual bubble sort in java and give the following information: a) I could sort 10 million integers using bubble sort in my computer. b) It took 5 hrs, 35 min, and 40 seconds to do that. Note that in order to the above, you should create an array and fill it with lots of random numbers (for example 10 million or 100 million or whatever maximum you can reach in your computer)

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!