Deck 2: Algorithm Discovery and Design
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 2: Algorithm Discovery and Design
1
When writing arithmetic expressions in pseudocode, you may assume that the computing agent executing your algorithm has all the capabilities of a typical calculator.
True
2
The fact that natural language can have many different meanings in different contexts makes it difficult to use for designing algorithms.
True
3
Pseudocode is a special set of English language constructs modeled to look like the statements available in most programming languages.
True
4
Control operations can be used to alter the normal sequential flow of control in an algorithm.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
A sequential algorithm executes its instructions in a straight line from top to bottom and then stops.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
Input and output allow the computing agent to communicate with the outside world.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
In a posttest loop, it is possible for the loop body to never be executed.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
Java and C++ are examples of pseudocode languages.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The if/then/else operation allows you to select exactly one of two alternatives.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
One of the most powerful features of a computer is its ability to handle loops.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The process of finding a solution to a given problem is called algorithm discovery.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
When writing arithmetic expressions in pseudocode, it is safe to assume that the computing agent already knows the basic trigonometric functions, sine, cosine, and tangent.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
In pseudocode, it does not matter exactly how you choose to write your instructions as long as the intent is clear and unambiguous.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
With a natural language, different readers can interpret the same sentence in totally different ways.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
Once an algorithm has been developed, it may itself be used in the construction of other algorithms.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
An unstructured, "free-flowing" writing style should be used for writing algorithms.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Languages such as Java and C++ are the algorithmic design languages of choice.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The three basic sequential operations are called addition, multiplication, and exponentiation.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Finding the maximum number in a given set is an example of a problem that computer scientists want to solve.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
Having an infinite loop in an algorithm is an error.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
If, then, and else are examples of ____ statements.
A) primitive
B) iterative
C) sequential
D) conditional
A) primitive
B) iterative
C) sequential
D) conditional
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
____ operations allow the computing agent to receive data values from the outside world that it may then use in later instructions.
A) ingoing
B) outgoing
C) input
D) output
A) ingoing
B) outgoing
C) input
D) output
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
In addition to designing a correct algorithm, computer scientists concern themselves with algorithmic efficiency.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Viewing an operation at a high level of abstraction and fleshing out the details of its implementation at a later time is known as ____ design.
A) bottom-up
B) top-down
C) increasing size
D) increasing depth
A) bottom-up
B) top-down
C) increasing size
D) increasing depth
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
____ is the process of searching for a special pattern of symbols within a larger collection of information.
A) Sequential search
B) Dynamic processing
C) Pattern matching
D) Pattern search
A) Sequential search
B) Dynamic processing
C) Pattern matching
D) Pattern search
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
____ is the ability to separate the high-level view of an entity or an operation from the low-level details of its implementation.
A) Inheritance
B) Randomness
C) Encapsulation
D) Abstraction
A) Inheritance
B) Randomness
C) Encapsulation
D) Abstraction
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
Computer algorithms are limited to accepting only two values as input.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
A purely ____ algorithm is also called a straight-line algorithm.
A) sequential
B) conditional
C) iterative
D) control
A) sequential
B) conditional
C) iterative
D) control
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
In a posttest loop, the continuation condition is tested at the ____ through the loop.
A) beginning of each pass
B) beginning of just the first pass
C) end of each pass
D) end of just the last pass
A) beginning of each pass
B) beginning of just the first pass
C) end of each pass
D) end of just the last pass
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
A ____ is the repetition of a block of instructions.
A) cycle
B) nucleus
C) matrix
D) loop
A) cycle
B) nucleus
C) matrix
D) loop
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Iteration should be minimized when designing algorithms.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
____ is an example of a natural language.
A) C
B) Java
C) English
D) Perl
A) C
B) Java
C) English
D) Perl
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The multiplication operation can be reduced to repeatedly adding a number a certain number of times.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
Most computer scientists use ____ to design and represent algorithms.
A) natural languages
B) high-level programming languages
C) low-level programming languages
D) pseudocode
A) natural languages
B) high-level programming languages
C) low-level programming languages
D) pseudocode
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
The technique of looking at all the items in a list, starting at the beginning of the list, one at a time, until we either find what we are looking for or come to the end of the list is called ____ search.
A) sequential
B) control
C) iterative
D) random
A) sequential
B) control
C) iterative
D) random
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Consider this line of code: Set the value of Area to length*width "Area" is a____.
A) value
B) variable
C) constant
D) primitive
A) value
B) variable
C) constant
D) primitive
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
A(n) ____ is a named storage location that can hold a data value.
A) expression
B) variable
C) computation
D) constant
A) expression
B) variable
C) computation
D) constant
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
The two parts of a "while" statement are known as the loop head and the loop body.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
Together, conditional and iterative operations are called ____ operations.
A) sequential
B) control
C) hierarchical
D) dynamic
A) sequential
B) control
C) hierarchical
D) dynamic
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
In a pretest loop, the continuation condition is tested at the ____ through the loop.
A) beginning of each pass
B) beginning of only the first pass
C) end of each pass
D) end of only the last pass
A) beginning of each pass
B) beginning of only the first pass
C) end of each pass
D) end of only the last pass
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
Which statement exemplifies abstraction?
A) The president of General Motors views the company in terms of every worker, every supplier, and every car.
B) The president of General Motors views the company in terms of its corporate divisions and high-level policy issues.
C) A good approach to algorithm design and software development, is to focus on how we might actually implement a particular operation.
D) A convenient way to view the hardware component called "memory" is to focus on the billions of electronic devices that go into constructing a memory unit.
A) The president of General Motors views the company in terms of every worker, every supplier, and every car.
B) The president of General Motors views the company in terms of its corporate divisions and high-level policy issues.
C) A good approach to algorithm design and software development, is to focus on how we might actually implement a particular operation.
D) A convenient way to view the hardware component called "memory" is to focus on the billions of electronic devices that go into constructing a memory unit.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
In the multiplication algorithm discussed in this chapter, the statement, "Get values for a and b" is a(n) ____ operation.
A) sequential
B) conditional
C) input
D) output
A) sequential
B) conditional
C) input
D) output
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The standard algorithm for searching a(n) ____ list of values is called sequential search.
A) ordered
B) unordered
C) numerical
D) alphabetical
A) ordered
B) unordered
C) numerical
D) alphabetical
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
A(n) ____ is a collection of useful algorithms.
A) primitive
B) binary
C) set
D) library
A) primitive
B) binary
C) set
D) library
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The design of an algorithm to solve a problem is highly dependent on the organization of the ____ involved in the problem.
A) words
B) data
C) solutions
D) pseudocode
A) words
B) data
C) solutions
D) pseudocode
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
How are the computer science terms, "index", and "pointer" related?
A) the index refers to the pointer
B) the pointer refers to the index
C) the index holds a value, while the pointer references a value
D) they are synonyms
A) the index refers to the pointer
B) the pointer refers to the index
C) the index holds a value, while the pointer references a value
D) they are synonyms
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
In order to implement a "find" functionality in a word processor, one would have to design a ____ algorithm.
A) pattern matching
B) natural language
C) sequential
D) do-while
A) pattern matching
B) natural language
C) sequential
D) do-while
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The ____ loop is an example of a posttest loop.
A) do-while
B) do
C) while
D) if-then-else
A) do-while
B) do
C) while
D) if-then-else
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
How could an algorithm fall into an infinite loop?
A) the input operations were missing
B) the algorithm uses more than one loop
C) the output operations were missing
D) the continuation condition of the loop never becomes false
A) the input operations were missing
B) the algorithm uses more than one loop
C) the output operations were missing
D) the continuation condition of the loop never becomes false
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
"Print the value of product" is an example of a(n) ____ operation.
A) sequential
B) conditional
C) input
D) output
A) sequential
B) conditional
C) input
D) output
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck