Question
Write at least one real world example for each of the following complexity type: O(lg n), O(n), O(nlgn), O(2 n ). Now, implement the above
Write at least one real world example for each of the following complexity type: 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(lgn) is Binary Searcht. Now implement actual bubble sort in java and give the following information: a) I could sort 10 million integers using Binary search 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started