2c03-review - 00090

# 2c03-review - 00090 - For all n n0 n*log(3/2 log c...

This preview shows page 1. Sign up to view the full content.

3 For all n n 0 , n*log (3/2) log c, then (3/2) n c. Hence, 3 n = (3/2) n * 2 n c*2 n . d.[2] log n + n 1/2 = O(log n) For all c 0, take n 0 = c 4 . For all n n 0 , log n + n 1/2 log c + n 1/4 *n 1/4 log c + c*n 1/4 c*log n hold. 4.[12] Consider lists of integers. The lexicographical ordering A < A on lists of integers is defined as follows. Let L 1 = a 1 , a 2 , . .. , a n , L 2 = b 1 , b 2 , . .. , b m , be two such lists. We say that L 1 < L 2 if and only if there exists some k such that 1 # k # n, 1 # k # m, a i = b i for all 1 # i # k, and either k=n or a k+1 < b k+1 . For example: > 3,4' < > 3,4,1', > 5,3,7,9'< > 5,3,9,7', > 1,7,8,8,9' < > 2,1,1'. Also, the lists L 1 and L 2 are said to be equal if and only if n=m and a i = b i for all 1 # i # n. Assume that the following operations are defined for the lists (see pages 38-39 of the textbook): INSERT(x, p, L). Inserts x at position p in list L, moving elements at p and the following positions to the next higher position. That is, if L is a
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online