SLIDE 1
1
COMP 250
Lecture 12
recursion 2:
power, binary search
- Oct. 4/5, 2017
recursion 2: power, binary search Oct. 4/5, 2017 1 Recall: - - PowerPoint PPT Presentation
COMP 250 Lecture 12 recursion 2: power, binary search Oct. 4/5, 2017 1 Recall: Converting to binary (iterative) k = 0 while n > 0 { b[ k ] = n % 2 n = n / 2 k++ } Recall that in binary needs approximately bits.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29