05-02-2017 CMSC 250 Problem (3): YOU write some (pseudo-)code! (90 pts) write a
ID: 3830836 • Letter: 0
Question
05-02-2017 CMSC 250 Problem (3): YOU write some (pseudo-)code! (90 pts) write a program in pseudocode (Similar to the code on the Big-o slides) for the following problems 1. (15 points) Given n, z1,z2,zs, 4 determine if there is a c c4 such that The program MUST run in O(m) time. 2. (15 points Given n z .z2.zs, do Two things: (1) determine if there is a ci, c2.cs,c4 such that AND (2) if there IS such a c c2, ca, cs then OUTPUT one such tuple The program MUST run in O(n) time. 3. (0 points but this is an HONORs PROBLEM) Given n,zi,r2,ra,z4 determine How MANY ci, cz.ca, are such that c4 The program MUST run in O(n) time. BEGIN YOUR ANSWER TO PROBLEM (3) BELOw THIS LINEExplanation / Answer
Solution:
1)
2)
I hope this helps. Don't forget to give a thumbs up if you like this.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.