Chapter 3: Algorithms
Q9E
Page 202
A palindrome is a string that reads the same forward and backward. Describe an algorithm for determining whether a string of n characters is a palindrome.
Q9E
Page 229
Give a big-o estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit string by examining each bit of the string to determine whether it is a 1 bit(see Exercise 25 of section 3.1).
Q9RE
Page 233
a.) Describe the insertion sort algorithm.
b.) Use the insertion sort algorithm to sort the list 2, 5, 1, 4, 3.
c.) Give a big-O estimate for the number of comparisons used by the insertion sort.
Q9SE
Page 233
Devise an algorithm that finds all equal pairs of sums of two terms of a sequence of n numbers, and determine the worst-case complexity of your algorithm.