Purchase Solution

Writing Pseudocode for Computing Values

Not what you're looking for?

Ask Custom Question

Suppose you are asked to compute the value of b^n for n, a large nonnegative integer. The simple solution is to compute the product b x b x ... x b involved n - 1 multiples. This takes time theta(n). Give a divide and conquer algorithm for the same problem that takes time theta(log(n)). you should state that the algorithm using pseudo-code. Follow this with a short analysis to show that you have achieved theta(log(n)) time.

Note: Your pseudo-code will be using "standard" multiples (i.e. you are not trying to make the simple multiply of two numbers any faster).

Purchase this Solution

Solution Summary

This solution provides a pseudocode for computing the value of b^n for n (a large nonnegative integer).

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.