Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer each part Part 1: Part 2: Part 3: Part 4: Part 5: Part 6: We are coding a structure called SuperStructure and a
Please answer each part
Part 1:
Part 2:
Part 3:
Part 4:
Part 5:
Part 6:
We are coding a structure called "SuperStructure" and a method called "fun". The size (number of elements) is obtained via "this.size()". The loop control variable "z" is changing logarithmically in the algo below. If "this.size()" is 1000000 , it will only loop about six times. The "fun" Algorithm: fun() \{ let z= this.size() let count =0 while (z>1){ count++ z=z/10 \} return count What is Big-O for the "fun" algorithm? log(O(n)) O(nlogn) O(logn) log (this.size()) What is Big-O for the "foo" algorithm (shown below)? The "foo" Algorithm: foo () \{ return this.sum(); O(1) O(n) O(logn) Not enough information to answer We are coding a structure called "SuperStructure" and a method called "go". The size (number of elements) is obtained via "this.size()". What is Big-O for the "superSum" algorithm? The "superSum" Algorithm: return 1000000000 ; O(1000000000) O(n) O(1) O(n2) What is the best definition below for Big-O using "amortized analysis"? Amortized analysis takes the average case Amortized analysis determines if there are any fast algorithm steps that may be used to increase the amortized efficiency of the algorithm. Amortized analysis determines if there are any less efficient algorithm steps that may be ignored from the complexity analysis because they are rarely performed. Amortized analysis takes the average of the upper and lower bounds of an algorithm Algorithm "A" is O (1) Algorithm "B" is O(n) We code "A" and "B". We start "A" and "B" at the same time. Which will finish first? A B Tie Unknown Which of the following is the best definition for Big-O complexity analysis? Big-O tells us the time it takes for an algorithm to run for a given struture size. Big-O tells us the time it takes for an algorithm to run as the structure size gets very large. Big-O tells us how much harder an algorithm works as structure size grows towards infinity Big-O tells estimates stress on the CPU for a given machine, for a given algorithmStep 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