Homework Assignment 3
- Page 153 describe the problem of peasant multiplication.
- Write a recursive algorithm for the multiplication operation mult(n, m).
- Write an iterative (non-recursive) algorithm. You will likely need a third variable to keep track of the sum and how it changes every time an odd \(n\) is encountered.
- Exercise 5.1.5 from page 175.
- Place the letters of word ALGORITHM in a search tree (insert them one at a time, don’t try to balance it). Then write out the order of vertices for each of the three traversals (in-order, pre-order, post-order).