Analysis of Algorithms
Home work 1 Solutions
Q2.3 Correctness of Horner's Rule
a
constant time operation (y = ai + x.y) is being run n times. Thus
running time is (n)
b
y = 0
for i = 0 to n
xp = 1
for j = 1 to i
xp = xp.x
y = y + xp.ai
constant time opera
Analsys of Algorithms - Homework 3 Solutions
Fall 2016
Exercise 15.4-4
When computing a particular row of the c table, no rows before the previous row are needed. Thus only
two rows - 2 length[Y ] entries - need to be kept in memory at a time. (Note: each
CSci 231 Homework 6 SOLUTIONS
Binary Search Trees and Hashing
CLRS Chapter 11.1-11.3 and 12.1-12.3
Write and justify your answers on this sheet in the space provided.1
1. (CLRS 12.2-5) Show that if a node in a binary search tree has two children, then its
Survey Paper: Sorting Algorithms
A sorting algorithm is an algorithm which results given elements in specified order. Sorting algorithms
are the most important algorithms in the area of computation. If we consider any list on the computer in
any applicati
Longest increasing subsequence
problem
Given an sequence of numbers, find the longest
subsequence with increasing elements
Example: A = (5, 1, 7, 9, 3, 6, 4, 2, 8) the longest
increasing subsequence is (1, 3, 4, 8)
Nave algorithms works in exponential tim