Test 1 Flashcards
What is an algorithm?
An unambiguous sequence of simple, mechanically executable instructions that solve a problem. A logical sequence of steps that will solve the correct problem.
What are functional requirements?
What the function has to do; functionality.
What are nonfunctional requirements?
Constraints, ex: max runtime
What does data turn into after being processed?
Information
What is a problem?
A question to which an answer is sought
What are parameters?
Input to the problem
What is restart penalty?
Time/effort cost accrued when a programmer looks at code that they either have never seen or haven’t seen in a while.
What is information?
Data that has meaning
How is an algorithm presented?
As an ordered sequence of instructions of finite size
What is a computing agent?
An actor that can react to the instructions and carry out the computations
What do all programs require?
An entry point and an end point
Why do many algorithms look like a coding language?
Because the writer works with that language frequently in day-to-day
Is there a fixed finite bound on the size of inputs?
No
Is there a fixed finite bound on the size of the ordered set of instructions?
No
Is there a fixed finite bound on the amount of memory space available?
No
Is there a fixed finite bound on the capacity or ability of the computing agent?
Yes (before parallelism)
What are problems?
Specific tasks solved by an algorithm.
What are parameters to the problem?
Variables that are not assigned specific values in the statement of the problem
What is an instance of the problem?
A specific assignment of values to the parameters.
What is a key?
An item that identifies a record
How do we know if a solution is efficient?
If it solves the problem within the require resource constraints
Why is Big O notation / complexity analysis useful?
It measures algorithm efficiency agnostic of program environment
What is the time complexity analysis of an algorithm?
The determination of how many times a basic operation is performed for each value of the input size.
What does T(n) represent?
The number of times the algorithm does the basic operation for an instance of size n. It is the every-case time complexity of the algorithm.
What does W(n) represent?
Worst case complexity analysis
What does A(n) represent?
Average case complexity analysis
What does B(n) represent?
Best case complexity analysis
What is memory complexity?
An analysis of how efficient the algorithm is in terms of memory.
What are the factors that should be taken into account when performing algorithm analysis?
1 Time it takes to execute the basic operation
2 Overhead instructions
3 Control instructions
How often does the worst case happen?
Not very often
What are overhead instructions?
Instructions that don’t increase with input size. Examples are initializations, setup, cleanup.
What are control instructions?
Calls that increase with input size. Ex: Range checking, operating system calls.
What are the properties of an algorithm and the implementation of the algorithm?
1 Basic Operations
2 Overhead Instructions
3 Control Instructions
What is analysis of correctness?
Analyzing an algorithm with the goal of proving that the algorithm actually does what it is supposed to do
What is the difference between pure quadratic functions and complete quadratic functions?
Complete quadratic functions contain a linear term, pure quadratic functions do not.
What is the term for an algorithm in Theta(n^2) time complexity?
Quadratic time algorithm
What is the growth rate?
The impact over time as n increases
What are some order complexity categories?
Big O of:
log n, n, n log n, n^2, 2^n, n!