JAVA PROBLEM... Problem: Consider the following function classes ordered by proper inclusion: (a) 𝑂(1000) (b) 𝑂(𝑙𝑜𝑔(𝑙𝑜𝑔(

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

JAVA PROBLEM... Problem: Consider the following function classes ordered by proper inclusion: (a) 𝑂(1000) (b) 𝑂(𝑙𝑜𝑔(𝑙𝑜𝑔(

Post by answerhappygod »

JAVA PROBLEM...
Problem: Consider the following function classes ordered byproper inclusion:
(a) 𝑂(1000)
(b) 𝑂(π‘™π‘œπ‘”(π‘™π‘œπ‘”(𝑛)))
(c) 𝑂(π‘™π‘œπ‘”(𝑛))
(d) 𝑂([π‘™π‘œπ‘”(𝑛)] 4 )
(e) 𝑂(2𝑛 + 1)
(f) 𝑂(𝑛 π‘™π‘œπ‘” (𝑛))
(g) 𝑂(𝑛 2 π‘™π‘œπ‘” (𝑛))
(h) 𝑂(𝑛 4 )
(i) 𝑂(3 𝑛 )
(j) 𝑂(𝑛 𝑛)
(k) π΅π‘œπ‘›π‘’π‘ : π‘π‘œπ‘‘ 𝑖𝑛 π‘Žπ‘›π‘¦ 𝑂(𝑔(𝑛)) π‘€β„Žπ‘’π‘Ÿπ‘’ 𝑔(𝑛) π‘Žπ‘› π‘Žπ‘Ÿπ‘–π‘‘β„Žπ‘šπ‘’π‘‘π‘–π‘π‘Žπ‘™π‘’π‘₯π‘π‘Ÿπ‘’π‘ π‘ π‘–π‘œπ‘› π‘œπ‘› 𝑛.
For each big-O class C as above, write a method taking apositive integer k that prints f(k) dots on the console where f(n)is of class C, but f(n) is not in any class appearing listed beforeC. For example, log(n) is in the class listed under (c), but it isneither in the one listed under (b) nor listed under (a). You arelimited to a sub-language of Java. You can ONLY use fixed incrementoperators, variable declarations, assignment operators, methodcalls, Boolean operators, multiplication and division by constants,and control-flow structures. Justify your choice. Avoid librarycalls, except to print a dot on the console.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply