Back to marketplace

Chapter 2

No description yet. This curated deck is ready for daily study.

Total cards: 21•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (21)

#1
Front (Question)

What is involved in the process of program development?

Back (Answer)

Problem description • Input • Result (output) Algorithm • Pseudocode is fine Program • Java, C, Python Machine instructions (executable)

#2
Front (Question)

How is pseudocode created?

Back (Answer)

It’s created from using components of natural language to express algorithms • Pseudocode = “Not real” Code

#3
Front (Question)

What are some issues with using natural language to represent algorithms?

Back (Answer)

• Natural language can be extremely verbose • Lack of structure makes it difficult to locate specific sections of the algorithm • Natural language is too “rich” in interpretation and meaning • Not sufficiently precise to represnt algorithms

#4
Front (Question)

Why is using pseudocode beneficial?

Back (Answer)

• Used to design and represent algorithms • A compromise between the two extremes of natural and formal languages • Will not be unique

#5
Front (Question)

Define: Sequential Algorithm

Back (Answer)

Sometimes called a straight-line algorithm; the order is followed in a linear fashion.

#6
Front (Question)

Define: Control Operations

Back (Answer)

• Conditional and iterative • Allow us to alter the normal sequential flow of control in an algorithm

#7
Front (Question)

Define: Conditional Statements

Back (Answer)

• The “question-asking” operations of an algorithm • If/then/else

Card back image
#8
Front (Question)

Define: Loop

Back (Answer)

• The repetition of a block of instructions • While or For loop statement

Card back image
#9
Front (Question)

Define: Continuation Condition

Back (Answer)

Determines if statement is true or false • if/elif statements

#10
Front (Question)

Give an example of a loop.

Back (Answer)

Card back image
#11
Front (Question)

Define: Pretest Loop

Back (Answer)

Continuation condition is tested at the beginning of each pass through the loop

#12
Front (Question)

Define: Posttest Loop

Back (Answer)

Continuation condition is tested at the end of the loop body, not the beginning.

#13
Front (Question)

Define: Primitives

Back (Answer)

Instructions that computing agent understands and is capable of executing without further explanation.

#14
Front (Question)

Define: Pattern Matching

Back (Answer)

• Process of searching for a special pattern of symbols within a larger collection of information. • Is assisting microbiologist and geneticists studying and mapping the human genome.

#15
Front (Question)

Give examples of higher-level constructs.

Back (Answer)

• Sort the entire list into ascending order. • Attempt to match the entire pattern against the text. • Find a root of the equation.

#16
Front (Question)

Define: Abstraction

Back (Answer)

Use of high-level instructions during the design process

#17
Front (Question)

Define: Top-down Design

Back (Answer)

Viewing an operation at a high level of abstraction

#18
Front (Question)

How to test efficiency of algorithms?

Back (Answer)

Run Time Analysis • Worst Case • Average Case Big Oh • Constant run time O(1) • Logarithmic run time O(logn) • Linear run time O(n) • Linearithmic run time O(nlogn) • Quadratic run time O(n2)

#19
Front (Question)

How to test efficiency of direct sequecing algorithms?

Back (Answer)

For a sequence of instructions, the cost of executing the sequence of instructions is, asymptotically speaking, the same as the maximum cost of the individual instructions. For three instructions a, b and c: • O({a, b, c}) = max (O(a), O(b), O(c)) where {a, b, c} represents direct sequencing of the three individual instructions.

#20
Front (Question)

How to test effeciency for conditional execution algorithms?

Back (Answer)

For a conditional statement, the cost of execution is the maximum of the cost of evaluating the condition and the cost(s) of the alternate instruction sequences • O(if {condition} then {sequence1} else {sequence2}) = max (O(condition), O(sequence1), O(sequence2))

#21
Front (Question)

How to test the effeciency of iterative construct algorithms?

Back (Answer)

Applies to an iterative construct ( e.g., loop, for, while) that will cause the execution of a subset of instructions to be repeated a specified number of times. The trick is to understand how many times the instructions will be repeated. For k iterations, the general rule is: • O(loop (k) {sequence}) = O(k*sequence)