Chapter 2 Flashcards

Invitation to Computer Science 8th ED

You may prefer our related Brainscape-certified flashcards:
1
Q

What does algorithmic problem solving focus on

A

Algorithmic problem solving focuses on algorithms suitable for computers such as searching lists and matching patterns

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

What is pseudocode

A

A tool for designing algorithms but does not run on a computing device

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

Describe natural language

A

Expressive and easy to use

Verbose, unstructured, and ambiguous

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

Describe programming language

A

Structured and designed for computers

Grammatically fussy and cryptic

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

Describe pseudocode in relation to natural and programming language

A

lies somewhere between the two and is used to design algorithms prior to coding them

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

What is the function of sequential operations

A

To perform a single task

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

What are the three basic sequential operations

A

Computation
Input
Output

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

What is computation (operation)

A

A single numeric calculation

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

What is input (operation)

A

Gets data values from outside the algorithm

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

What is output(operation)

A

sends data values to the outside world

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

What is a sequential algorithm

A

An algorithm made up only of sequential operations

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

What is a variable

A

a named storage location to hold a data value

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

What is a control operation

A

changes the normal flow of control

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

What is a conditional statement

A

asks a question and selects among alternative options

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

What is the first step of a conditional statement

A
  1. evaluate the true/false condition
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the second step of a conditional statement

A
  1. If the condition is true then do the first set of operations and skip the second set
17
Q

What is the third step of a conditional statement

A
  1. If the condition is false, skip the first set of operations and do the second set
18
Q

What is an iteration

A

an operation that causes looping, repeating a block of instructions

19
Q

What is a continuation condition

A

A test to see if while loop should continue

20
Q

What is a loop body

A

instructions to be performed repeatedly

21
Q

What is true about a do/while and an alternate iterative operation

A

continuation condition appears at the end and loop body is always performed at least once

22
Q

What are the primitive operations

A

sequential, conditional and iterative are all that is needed

23
Q

What is a library

A

a collection of prewritten, useful algorithms

24
Q

What is pattern matching algorithms used for

A

to locate every occurrence of the given pattern within the text.

25
Q

What is the output of the pattern matching algorithm

A

the locations in the text where each match occurred

26
Q

What are the two parts of an algorithm

A
  • *Sliding the pattern along the text, aligning it with each position in turn
  • *Given a particular alignment, determine if there is a match at that location
27
Q

How do you solve an algorithm

A

Solve each part separately and/or use abstraction and top-down design

28
Q

What is abstraction in relation to an algorithm

A

when you focus on high level and not the details

29
Q

what is top-down design in relation to an algorithm

A

start with the big picture and gradually elaborate parts