Unit 1 Flashcards
To determine the best algorithms to use, computer scientists analyze the complexity of the algorithm by comparing two algorithms at the blank level
idea
To analyze algorithm complexity, computer scientists use pragmatic tools such as blank, blank and blank notations to formally measure how fast a program or algorithm runs.
big-O, Theta, and Omega
An blank is a step-by-step method for solving a problem. A description of an algorithm specifies the input to the problem, the output to the problem, and the sequence of steps to be followed to obtain the output from the input.
algorithm
Algorithms are often described in blank, which is a detailed yet readable description of what an algorithm must do, expressed in a formally-styled natural language rather than in a programming language.
pseudocode
An important type of step in an algorithm is an blank, in which a variable is given a value.
assignment
An assignment operator is denoted by:
blank
x := y
The output of an algorithm is specified by a blank statement.
return
A description of an algorithm starts with the blank.
name of the algorithm
The name is followed by a blank of what the algorithm computes
description
A description of an algorithm usually includes what five steps:
A name for the algorithm
A brief description of the task performed by the algorithm
A description of the input
A description of the output
A sequence of steps to follow
An blank tests a condition, and executes one or more instructions if the condition evaluates to true.
if-statement
In a blank, a condition and instruction appear on the same line.
single line if-statement
What is the notation for an if-statement?
If (x = 5), y := 7
An if-statement can also be followed by a blank of indented operations with a final end-if statement.
If ( condition )
Step 1
Step 2
. . .
Step n
End-if
sequence
An blank tests a condition, executes one or more instructions if the condition evaluates to true, and executes a different set of instructions if the condition evaluates to false
if-else-statement
Name the pattern for if-else statement
If ( condition )
One or more steps
Else
One or more steps
End-if
An if-then statement tests a blank and executes one or more steps if the condition is true. An if-else statement tests the condition, and executes one or more instructions if the condition is true, and another instruction or set of instructions if it is false.
condition
The structure of the if-then statement in pseudocode when there is only one step to execute when the condition is true is:
blank
If(condition), step
When multiple steps should be performed upon a true condition, the steps are indented and the end of the list of steps is noted with an blank statement:
End-if
The if-else statement in pseudocode is formatted in what format:
If (condition)
One or more steps
Else
One or more steps
End-if
The multiple step if statement in pseudocode is formatted in what format:
If (condition)
Step 1
Step 2
…
Step n
End-if
When needed, if-then and if-else statements can be blank
nested.
There are blank regarding how many if-then or if-else statements can be placed under another if-then or if-else statement.
no limitations
An blank is a process where a set of instructions or structures are repeated in a sequence a specified number of times or until a condition is met.
iteration