Problem 1: Give an asymptotic estimate, using the O-notation, of the number of letters printed by the algorithms given 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

Problem 1: Give an asymptotic estimate, using the O-notation, of the number of letters printed by the algorithms given b

Post by answerhappygod »

Problem 1 Give An Asymptotic Estimate Using The O Notation Of The Number Of Letters Printed By The Algorithms Given B 1
Problem 1 Give An Asymptotic Estimate Using The O Notation Of The Number Of Letters Printed By The Algorithms Given B 1 (61.8 KiB) Viewed 37 times
Problem 1: Give an asymptotic estimate, using the O-notation, of the number of letters printed by the algorithms given below. Give a complete justification for your answer, by providing an appropriate recurrence equation and its solution. (a) algorithm Print As(n) (b) algorithm Print Cs(n) if n <3 then if n < 2 then print("A") print("C") else else for j+1 to na for j1 to na do print("A") do print("C") for it1 to 5 do PrintCs( [n/2]) PrintAs( [n/4]) Print Cs( [n/2]) Print Cs( [n/2]) Prints([n/2]) (c) algorithm PrintDs(n) if n > 5 then print("D") if r is even then PrintDs( [n/5) PrintDs( [n/51) r+1 else PrintDs( [n/51) Print Ds( [n/5]) 22.0 In part (c), variable x is a global variable initialized to 1.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply