Tutorial 1 algorithms
Tutorial 1 algorithms
Tutorial: 01
Objective 1: Comparing two functions
Objective 2: Counting the loop execution
Tut No. Name CO 1 CO 2 CO 3
1. Tutorial:01 √
3. Algorithms A and B spend exactly TA(n) = cAn log2n and TB(n) = cBn2
microseconds, respectively, for a problem of size n. Find the best
algorithm for processing n = 220 data items if the algorithm A spends 10
microseconds to process 1024 items and the algorithm B spends only 1
microsecond to process 1024 items.