Asymptotic Analysis (Discussion 7) (Phân tích tiệm cận) - Christine Zhou

UN
Uni24h
0 downloads
11
0

Document content

Page 3

Announcements - Remember to commit frequently! - HW4 was due yesterday - Proj1 is due this Friday! - Extra OH on Wednesday 6-8PM, Thursday 7-9PM, most likely in the labs! - Extra credit opportunity: Mid-semester survey! Keep your eyes peeled - Advising Sessions: tinyurl.com/cs61b-advising - CS 370 Signups! - Discussion survey: tinyurl.com/disc7cz

Page 5

Practice Problem public void hello(int n) { if (n == 0) { return; } else { for (int i = 0; i < 10000000; i += 1) { System.out.println(“hello”); } hello(n-1); } } Let’s draw the “work done” tree!

Page 6

2 Recursive Running Time There are some typos on the discussion sheet, sorry!! public void andslam(int N) { if (N > 0) { for (int i = 0; i < N; i += 1) { System.out.println(“bigballer.jpg”); } andslam(N/2); } }

Showing the first 6 pages. Download the document to see it all.

Comments (0)

Sign in to join the discussion

No comments yet. Be the first!