LAB5 Agenda

Room

08:30- 10:30
Data Structures and Algorithms Ex C

C2.01 Lecture room, Ser-C


Agenda for Today: Assignments Discussion



Assignment 3 ~ 30 min


Assignment 2 - ~1h

Some observations:

Ex 2.1

Ex 2.2

Ex 3

]
What is an efficient algorithm? How do we know in principle?
The one with the best running Theta(f(n))
Draw a matrix
How you typically did a solution:

    INPUT: A (size n)
    OUTPUT: M

    tmpSum:=0
    for i:=1 to n do
            for j:=1 to n do
                if j < i  
                then M[i][j] = 0
                else M[i][j] = findAverage(A,i,j)
    for i:=1 to n do
            for j:=1 to n do
                if j < i  
                    then M[i][j] = 0
                    else
                        tmpSum += A[j];
                        M[i][j] = tmpSum/(j-i+1)
n = 10      n = 100     n = 1000    n = 10000       n=100000
35637       10404086    523427658   239990361600    2342333455565
35637       10404086    523427658   239990361600    2342333455565
35637       10404086    523427658   239990361600    2342333455565
35637       10404086    523427658   239990361600    2342333455565
35637       10404086    523427658   239990361600    2342333455565
-----------------------------------------------------------------
35637       10404086    523427658   239990361600    2342333455565
n = 10      n = 100     n = 1000    n = 10000      n=100000
10x         100x        1000x       1000000x       1000000000x
n = 10      n = 100     n = 1000    n = 10000      n=100000
10x         100x        1000x       100000x        100000000x

Assignment 2 ~ 30 min