• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/20

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

20 Cards in this Set

  • Front
  • Back

Which of the following is an activity?




A. Algorithm


B. Program


C. Process

C. Process

Which of the following is a representation?




A. Algorithm


B. Program


C. Process

B. Program

Which of the following set of instructions 
defines an algorithm in the formal, strict sense?

Which of the following set of instructions


defines an algorithm in the formal, strict sense?





B.

Which of the following is not a means of repeating a block of instructions?




A. Pretest loop


B. Posttest loop


C. Recursion


D. Assignment statement

D. Assignment statement

When searching within the listLewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tomwhich of the following entries will be found most quickly using the sequential search algorithm?


A. Lewis


B. Pat


C. Tom

A. Lewis

When searching within the listLewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tomwhich of the following entries will be found most quickly using the binary search algorithm?


A. Lewis


B. Pat


C. Tom

B. Pat

Which of the following lists would not be obtained at some point when applying the insertion sortalgorithm to the list below?SylviaNancyLoisAlice


A. Nancy Sylvia Lois Alice


B. Alice Lois Nancy Sylvia


C. Alice Sylvia Nancy Lois


D. Lois Nancy Sylvia Alice

C. Alice Sylvia Nancy Lois

In general, an algorithm in which of the following categories is considered more efficient?




A. (lg n)


B. (n)


C. (n lg n)


D. ( n^2)

B.

The insertion sort algorithm is an example of an algorithm in which of the following classes?




A. (lg n)


B. (n)


C. (n lg n)


D. ( n^2)

D.

The binary search algorithm is an example of an algorithm in which of the following classes?


A. (lg n)


B. (n)


C. (n lg n)


D. ( n^2)

A.

Under the assumption that X takes on only integer values, which of the following is the terminationcondition for the following loop? while (X < 5) do


( . . . )


A. X < 5


B. X > 4


C. X < 4

B. X > 4

Under the assumption that X takes on only integer values, which of the following is the terminationcondition for the following loop? repeat ( . . . )


until (X < 5)


A. X < 5


B. X > 4


C. X > 5

A. X < 5

Under the assumption that N takes on only integer values, which of the following is the terminationcondition in the following recursive procedure?


procedure xxx (N)if (N < 5) then (apply the procedure xxx to the value N + 1) else (print the value of N)


A. N < 5


B. N > 4


C. N < 4

B. N > 4

Under the assumption that N takes on only integer values, which of the following is the terminationcondition in the following recursive procedure?


procedure xxx (N)if (N < 5) then (print the value of N) else (apply the procedure xxx to the value N - 1)


A. N < 5


B. N > 4


C. N > 5

A. N < 5

Which of the following is a loop invariant at the point at which the test for termination is performed inthe following loop structure?


X <-- 3;


while (X < 5) do


(X <-- X + 2)




A. X > 5


B. X < 5


C. X >= 5


D. X <= 5

D. X <= 5

Which of the following is a loop invariant at the point at which the test for termination is performed inthe following loop structure


X <-- 3;


repeat (X <-- X + 2)


until (X > 5)




A. X > 5


B. X < 8


C. X >= 5


D. X <= 6

B. X < 8

7. Which of the following is the base case in the recursive procedure below?


procedure xxx (N)


if (N = 0) then (print the value of N)


else (apply the procedure xxx to the value N-1)




A. N > 0


B. N = 0


C. N < 0

N = 0

Preconditions, postconditions, and loop invariants are examples of which of the following?




A. Pseudocode


B. Iterative structures


C. Assertions


D. Recursion

C. Assertions

Which of the following does not print the same sequence of numbers as the others?


A. X <-- 5


while (X < 6) do


(print the valueof X; X <-- X + 1)


B. X <-- 4


while (X < 5) do


(X <-- X +1;


print the value of X)


C. X <-- 5


repeat


(print the value X <-- X + 1)


until (X > 6)

C.

Which of the following is not a way of representing algorithms?




A. Stepwise refinement


B. Pseudocode


C. Flowchart


D. Programming language

A. Stepwise refinement