• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/40

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

40 Cards in this Set

  • Front
  • Back

What is Running Time?

A measure of 'Goodness' for software data structures and algorithms.

True or False: In general, Running Time increases with more input.

True

Hardware that affects Running Time includes ___________, ___________, ___________, and ___________.

- Processor speed


- Clock rate


- Memory size/speed


- Disk types/speed

Factors of the software environment that affect Running Time include ___________, ___________, and ___________.

- Operating system


- Programming language


- Compiler/Interpreter

Which two approaches are used to measure Running Time?

- Experimental Study


- Theory Analysis

Describe steps taken in the Experimental Study method for studying Running Time.

1) Implement the algorithm in question (code it).




2) Apply tests to algorithm using various sized inputs (record actual time spent at each input size using system calls or profiling in the O/S to determine Running Time).




3) Graph the results for visualization purposes.





Describe 3 limitations of the Experimental Study method for studying Running Time.

1) Experiments only done on a representative set of inputs (not all sets can be tested).




2) The same hardware/software must be used to make the comparisons valid.




3) Algorithm must already be fully implemented to test it properly (most expensive).

Describe 3 benefits of the Theory Analysis method for studying Running Time.

1) Algorithms are not implemented nor are experiments run (less expensive).




2) Allows us to take into account all possible inputs.




3) Allows evaluation of any 2 algorithms regardless of hardware and software.

List the 5 Running time functions we've talked about in this course (in order of execution time).

1) Constant


2) Logarithmic


3) Linear


4) Quadratic


5) Exponential





The function that demonstrates Constant Running Time is expressed as ___________.

f(n) = c

In the 'f(n)' part of Running Time functions, what does 'n' represent?

The input size

True or False: A Constant Running Time will operate at the same time no matter the size of the input.

True

The function that demonstrates Linear Running Time is expressed as ___________.

f(n) = n

A Linear Running Time function operates how many times for each input?

Once

The function that demonstrates Quadratic Running Time is expressed as ___________.

f(n) = n^2

Quadratic Function Example:




If I select 2 students and write every combination of their names, I have n^2 = 2^2 = 4 combinations. How many combinations do I have if I choose 5 students?

n^2 = 5^2 = 25 combinations

The function that demonstrates Exponential Running Time is expressed as ___________.

f(n) = b^n

The function that demonstrates Logarithmic Running Time is expressed as ___________.

f(n) = logbn

True or False: With Logarithmic Running Time, after enough input, the more input, the less time it takes.

True

True or False: The Quadratic function is suitable for all input sizes.

False. It increases quickly, so is only suitable for small input sets.

True or False: The Exponential function grows rapidly and is mostly unusable.

True

The function that demonstrates Constant Running Time is expressed as ___________.

f(n) = c

True or False: Functions (if possible) should execute in constant or logarithmic time.

True

True or False: The Linear function is not acceptable and is rarely used.

False. The Linear function is acceptable and must be used in many cases.

True or False: Quadratic and Exponential functions should be avoided.

True

True or False: Algorithm Analysis involves counting primitive operations in a routine.

True



What is a primitive operation?

A step the CPU must make to execute an instruction.

True or False: High level languages often have several primitive operations per statement.

True

For Asymptotic notation, Best Case Execution is also referred to as ___________.

Big Omega notation (aka Big-<insert omega symbol here> notation)

Pg. 34 in lecture 1

True or False: For Asymptotic notation, Best Case Execution expresses the execution for an algorithm as fast as it can possible be.

True

For Asymptotic notation, Worse Case Execution is also referred to as ___________.

Big-O

True or False: For Asymptotic notation, Average Case Execution expresses the execution of an algorithm with an average amount of inputs.

True

True or False: Average Case Execution is commonly used to figure out how a program will run with normal inputs.

False. Average Case Execution is typically not used to the complexities involved (requires extensive use of mathematics and probability theory).

Between Best and Worst Case Execution, which is better to use in algorithm design?

Worst Case Execution


- Operates well regardless of input size.


- Usually easy to identify the worst case.

Changes in execution time as a result of input size are specified using ___________ notation.

Big-O


- Specifies the worst case for an algorithm

Describe two reasons we should care about expressing Running Time in Big-O notation?

- Tells us how long an algorithm can take in general terms.




- Shows how well our solution scales as the amount of input increases.



For Big-O notation, Constant execution times are expressed as ___________.

O(1)

For Big-O notation, Logarithmic execution times are expressed as ___________.

O(Logn)

For Big-O notation, Linear execution times are expressed as ___________.

O(n)

For Big-O notation, Exponential execution times are expressed as ___________.

O(b^n)