What is the order of each of the following functions?
Want to see the full answer?
Check out a sample textbook solutionChapter 22 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Additional Engineering Textbook Solutions
Experiencing MIS
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out With Visual Basic (8th Edition)
Experiencing MIS
Using MIS (10th Edition)
C++ How to Program (10th Edition)
- 51 Given the following function: def F1(n): k=0 for i in range (1, (n*n*n*n)/2): for j in range(0, i): k += i return What is the time complexity of the function F10? Enter your answerarrow_forwardOrder the following functions by growth rate 250 N VN N1.5 N? NlogN NloglogN Nlog?N Nlog(N?) 2/N 2N 37 N²logN N3 Indicate which of the functions grow at the same rate.arrow_forwardQ7. The big O bound for the following functions is T(n)= nlogn2+ nlogn OO (log(log n)) OO (nlogn) 00 (n² log n) 00 (n²)arrow_forward
- Question 19. The following function f uses recursion: def f(n): if n 0 a <- a +i+ (1-1) return a c) def f(n): arr [0] <- 0 arr[1] <- 1 if n <= 1 return arr [n] else for i in 2..n arr [i] <- arr[i-1] + arr[i-2] return arr [n] d) def f(n): arr[0..n] <- [0, .., n) if n <= 1 return arr [n] else a <- 0 for i in 0..n a <- a + arr [i] return aarrow_forwardWrite a function that given an integer N returns the maximum possible value obtained by deleting one 5 digit from the decimal representation of N it is guaranteed that N will contain at least one 5 digitarrow_forwardYihan recently learned the asymptotical analysis. The key idea is to evaluate the growth of a function. For example, she now knows that n² grows faster than n. She wants to know whether she really understands the idea, so she has created a little task. First of all, she found a lot of functions here: 91 3n log n² 92: n! log(n!) 93 911 √n 912 log log n 98 2n+1 913 (n+1)! 918 nlogn 99 ln ln n 914 Vlogn 919 5n² 13n+6 910: 10000 915 log √n 920 n/logn Note: log n = log₂ n; ln n = log n; log² n = = (log n)²; n! is the factorial of n, i.e., n! = 1 × 2 × · • × n. Reading the long list, Yihan realized that things were not as simple as she thought. Could you help her with the following problems? For all the questions in this problem, you only need to show your answer without explaining. The only exception is question (4), where you need to show proofs or explanations. (1) 94 : n³ 95 log² n (2) n² + n (3) 96 916 n 97 917 22 What does polylogarithmic mean (use O(.), N(.), w(.), ©(.), o(.) to…arrow_forward
- Which of the following is the time equation of the Hesap function? Hesap(n) if n==0 return 1 else return Hesap(n/2)*Hesap(n/2) end end A.T(n) = 2T(n/2) + θ (n) B.T(n) = T(n/2) + θ(n) C=T(n) = 2T(n/2) + θ(1) D. T(n) = T(n/2) + θ(1)arrow_forwardWhat value is returned by the following function? Express your answer as a function of n. Give the worst-case running time using the Big-Oh notation.arrow_forward6. Find the big O of the function ƒ(n) = n² + n" 2"arrow_forward
- inf unknown(int n) int i, j.k-0, for (i n/2; iarrow_forwardSIC ty.com/player/ ster A O O Consider the following code which will print the nth term of a Fibonacci sequence. def fibonacci(n): if n English SAVE Sign out Kinl Section 5 of 5 SUBMI ©2016 Glynlyon, Inc. All rights reserve Mar 27 2arrow_forwardFor each of the following function, indicate the class Q(n) the function belongs (use the simplest g(n) possible in your answer. a) (n + 1)10 b) 2nlog2(n+2)2 + (n+2)2log2(n/2) c) 2n+1+ 3n-1 d) (n 2 / 2) - 4narrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT