Analysis tools Flashcards

1
Q

List all the seven functions in ascending order

A
  1. Constant
  2. log n
    3, Linear
  3. n log n
  4. quadratic
  5. cubic
  6. exponentia;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a data structure? What is an Algorithm? And how do they affect runtime

A

A data structure is a systematic way of organizing and reaching data.

An algorithm is a set of instructions specifying how a specific task must be done within a finite amount of time

They affect runtime deciding how quickly accessible the data in the data structure is, which in turn affects runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would you perform experimental studies on an algorithm?

A

Run the algorithm on a machine, test the algorithm with various input, measure the time the algorithm takes to run by using system.currenttimemillis() and record the results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the limitations of Experimental studies?(3)

A
  1. It is sometimes impractical to test all possible input
  2. The results will not be the same across different machines unless the hardware, software and other contributing factors are exactly the same
  3. You have run the whole algorithm in order to analyze it and who knows how long that will take
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is runtime analysis better?(3)

A
  • It takes into account all inputs
  • Will analyze the algorithm without implementing it
  • Will analyze the algorithm the same regardless of hardware and software
How well did you know this?
1
Not at all
2
3
4
5
Perfectly