Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 1: Solution
1. Prove the following.
(a) n Z, if n is odd then n2 is odd.
Solution:
Direct
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 3: Solution
1. Solve the following recurrences.
(a) T (n) = T (n/2) + O(n)
Solution:
T (n
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 4
Due: Monday, February 24, 2014 (during TA Office hours)
Note: Collaboration on homework
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 2: Solution
1. Prove the following.
(a) (Optional ) a, b, c Z, if a2 + b2 = c2 , then a o
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 4: Solution
1. An inversion in an array A[1 . . n] is a pair of indices (i, j) such that
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 6: Solution
1. We saw in class that after inserting an element in any AVL tree, we requir
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 2
Due: Friday, February 07, 2014 (in class)
Note: Collaboration on homeworks is encourage
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 1
Due: Wednesday, January 29, 2014 (in class)
Note: Collaboration on homeworks is encoura
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 6
Due: Monday, April 07, 2014
Note: Collaboration on homeworks is encouraged. However, yo
Lahore University of Management Sciences
CMPE 510: Design & Analysis of Algorithms (Spring 2013-2014)
Homework 3
Due: Friday, February 14, 2014 (in class)
Note: Collaboration on homeworks is encourage