Question 1 Consider the following segment of an algorithm: i = 1 Loop while (i < n) print("Hello World!") i - i * 3 Which one of the following options about the runtime R(n) is true? A. R(n) = 0(n³) B. R(n) = 0(log³n) C. R(n)= 0(3") D. R(n)= 0(log3 n) E. R(n) = 0(³√n) Question 2 Which of the following is NOT true? A. n2 € 0(n3) E B. log(n!) € O(n) C. log(n!) E (logn) D. 4¹ € 0(2) E. n² € (nlgn) Question 3 Suppose T is a binary search tree storing n entries. Which one of the following statements is true? A. Inserting into T is 0(1) in the best case and 0(log n) in the worst case. B. Inserting into T is 0(1) in the best case and 0(n) in the worst case. C. Inserting into T is 0(log n) in the best case and 0(log n) in the worst case. D. Inserting into T is 0(log n) in the best case and 0(n) in the worst case. E. Inserting into T is O(n) in the best case and 0(n) in the worst case.
Question 1 Consider the following segment of an algorithm: i = 1 Loop while (i < n) print("Hello World!") i - i * 3 Which one of the following options about the runtime R(n) is true? A. R(n) = 0(n³) B. R(n) = 0(log³n) C. R(n)= 0(3") D. R(n)= 0(log3 n) E. R(n) = 0(³√n) Question 2 Which of the following is NOT true? A. n2 € 0(n3) E B. log(n!) € O(n) C. log(n!) E (logn) D. 4¹ € 0(2) E. n² € (nlgn) Question 3 Suppose T is a binary search tree storing n entries. Which one of the following statements is true? A. Inserting into T is 0(1) in the best case and 0(log n) in the worst case. B. Inserting into T is 0(1) in the best case and 0(n) in the worst case. C. Inserting into T is 0(log n) in the best case and 0(log n) in the worst case. D. Inserting into T is 0(log n) in the best case and 0(n) in the worst case. E. Inserting into T is O(n) in the best case and 0(n) in the worst case.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 18PE
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning