CS255
Chris Pollett
Feb 5, 2018
Suppose you flip a fair coin n times. What is the longest streak of consecutive heads you expect to see?
Which of the following statements is true?
On-Line-Maximum(k,n) 1 bestscore = -infinity 2 for i := 1 to k 3 if score(i) > bestscore 4 bestscore := score(i) 5 for i := k + 1 to n 6 if score(i) > bestscore then return i 7 return n