Analyzing the complexity of addition and multiplication
Not what you're looking for?
Use big-O notation to classify the traditional grade school algorithms for addition and multiplication. That is, if asked to add two numbers each having N digits, how many individual additions must be performed? If asked to multiply two N-digit numbers, how many individual multiplications are required?
Purchase this Solution
Solution Summary
This solution provides a detailed analysis of the basic addition and multiplication algorithms that grade school students learn.
Solution Preview
The algorithm for addition is as follows: For each digit, from right to left, add the digit to the corresponding digit in the other number. Apply the "carry" if needed. There is one addition operation per digit. So the complexity, in big-O notation, is O(n).
Example: Consider adding 123 ...
Purchase this Solution
Free BrainMass Quizzes
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
C# variables and classes
This quiz contains questions about C# classes and variables.
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.
Basic Networking Questions
This quiz consists of some basic networking questions.
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.