* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Download M(n)
Survey
Document related concepts
Transcript
Binary Method Repeated Squaring Method Repeated Doubling Method Phase I (Repeated Doubling) For log2 n stages: Add largest so far to itself (1, 2, 4, 8, 16, . . . ) Phase II (Make n from bits and pieces) Expand n in binary to see how n is the sum of Bn powers of 2. Use Bn-1 stages to make from the powers of 2 created in phase I Total Cost: n log2 n ï« Bn ï 1