Assignment 1
Assignment 1
Que 1 A sorting method with “Big-Oh” complexity O(n log n) spends exactly 1 millisecond to sort 1,000
data items. Assuming that time T(n) of sorting n items is directly proportional to n log n, that is,
T(n) = cn log n, derive a formula for T(n), given the time T(N) for sorting N items, and estimate
how long this method will sort 1,000,000 items.
Que 2 A quadratic algorithm with processing time T(n) = cn2 spends T(N) seconds for processing N data
items. How much time will be spent for processing n = 5000 data items, assuming that N = 100
and T(N) = 1ms?
Que 3 Assume that each of the expressions below gives the processing time T(n) spent by an algorithm
for solving a problem of size n. Select the dominant term(s) having the steepest increase in n
and specify the lowest Big-Oh complexity of each algorithm.