Exam 4: Networking and the Internet

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

List three of the primitives in the pseudocode developed in this chapter. ____________________ ____________________ ____________________

Free
(Essay)
4.8/5
(23)
Correct Answer:
Verified

Possible answers include: the assignment statement using \leftarrow , the if-then-else statement, the while statement, the repeat statement, and the definition and activation of procedures.

Which of the sequential or binary search algorithms would find the name Roger in the list John, Kelly, Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom more quickly? _______________

Free
(Short Answer)
4.9/5
(39)
Correct Answer:
Verified

Binary

Identify a loop invariant associated with the point in the loop below at which a test for termination is performed. Identify a loop invariant associated with the point in the loop below at which a test for termination is performed.

Free
(Essay)
4.8/5
(36)
Correct Answer:
Verified

Possible answers include: X > 0, X < 9, X is an even integer, and others

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

(Multiple Choice)
4.9/5
(35)

Which of the following lists would not be obtained at some point when applying the insertion sort algorithm to the list below? Sylvia Nancy Lois Alice

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.8/5
(38)

Under the assumption that N takes on only integer values, which of the following is the termination condition 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)

(Multiple Choice)
4.8/5
(46)

Circle the portion of the program below in which control of the loop is initialized. Draw a rectangle around the portion in which the test for termination is performed. Underline the portion in which the state of the loop is moved toward the termination condition. Circle the portion of the program below in which control of the loop is initialized. Draw a rectangle around the portion in which the test for termination is performed. Underline the portion in which the state of the loop is moved toward the termination condition.

(Essay)
4.8/5
(32)

Under the assumption that N takes on only integer values, which of the following is the termination condition 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)

(Multiple Choice)
4.9/5
(37)

Use a repeat loop structure to produce a non-recursive program segment that prints the same sequence of numbers as the following recursive procedure. Use a repeat loop structure to produce a non-recursive program segment that prints the same sequence of numbers as the following recursive procedure.

(Essay)
4.9/5
(43)

Which of the following is a representation?

(Multiple Choice)
5.0/5
(34)

Use a repeat loop rather than a while loop to accomplish the same results as the following program segment. Assume that X will have only integer values. (You may also use an if statement if you like.) Use a repeat loop rather than a while loop to accomplish the same results as the following program segment. Assume that X will have only integer values. (You may also use an if statement if you like.)

(Essay)
4.7/5
(40)

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

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(37)

Identify a flaw in the control of the following loop. Identify a flaw in the control of the following loop.

(Essay)
4.7/5
(39)

Do the following instructions define an algorithm? Explain your answer. Write down all the positive odd integers. Select the integer in the middle of the list. Print the even integer that is one less than the selected odd integer.

(Short Answer)
4.9/5
(35)

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

(Multiple Choice)
4.8/5
(38)

Which of the sequential or binary search algorithms would find the name Kelly in the list John, Kelly, Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom more quickly? _______________

(Short Answer)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(36)

Fill in the blank in the procedure below so that the procedure prints the integers from 0 up to the integer value it was given for N. That is, if the procedure is executed with the value of N being 3, it should print 0, 1, 2, 3. Fill in the blank in the procedure below so that the procedure prints the integers from 0 up to the integer value it was given for N. That is, if the procedure is executed with the value of N being 3, it should print 0, 1, 2, 3.

(Short Answer)
4.7/5
(29)
Showing 1 - 20 of 33
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)