{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW4-W07-full

# HW4-W07-full - Homework Four CS 191 Discrete Structures I...

This preview shows pages 1–3. Sign up to view the full content.

Homework Four CS 191 : Discrete Structures I Mar. 6 , Winter 2007 Due Date: Mar. 20, 2007, Tuesday, before the class meeting. Section 4.2, p155 ___________________________________________________ Exercise (15) Write an algorithm whose input is a sequence s 1 , …, s n sorted in nondecreasing order and a value x . (Assume that all the values are real numbers.) The algorithm inserts x into the sequence so that the resulting sequence is sorted in nondecreqsing order. Example: If the sequence is 2, 6, 12, 14, and x = 5, the resulting sequence is 2, 5, 6, 12, 14. ____________________________________________________ Exercise (18) Describe the worst case input for algorithm 4.2.1. _____________________________________________________ Section 4.3, p168 Select a theta notation from Table 4.3.3 for each expression in exercises 1-12. Exercise (6) 4 6 6 + + n n _______________________________________________________________ Exercise (9) (6 n + 4)(1+lg n ) __________________________________________________________ Exercise (11) n n n n n 2 2 ) 1 )( lg ( + + + _______________________________________________________ Exercise (12) 2+4+8+16+…+ 2 n 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
__________________________________________________ In Exercises 13-15, select a theta notation for f(n) + g(n). Exercise (15) f ( n ) = Θ ( n 3/2 ), g ( n ) = Θ ( n 5/2 ), _________________________________________________ In exercises 16-26, select a theta notation from among Θ (1), Θ (lg n ), Θ ( n ), Θ ( n lg n ), Θ ( n 2 ), Θ ( n 3 ), Θ (2 n ), or Θ ( n !).
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern