Mena Sargios
Quiz por , criado more than 1 year ago

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU

23
0
0
Mena Sargios
Criado por Mena Sargios mais de 7 anos atrás
Fechar

8. Algorithm Case Study

Questão 1 de 15

1

Binary search works on both sorted and non-sorted arrays.

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 2 de 15

1

With Sequential search having an average O(N) and Binary search having an average O(logN), Which is quicker to use?

Selecione uma das seguintes:

  • Binary search

  • none of the above

Explicação

Questão 3 de 15

1

When dividing a list in twos what do you do when its not evenly divided by power of 2?

Selecione uma das seguintes:

  • A.take the lowest value of 2 you can find

  • B,find the the numbers that its inbetween

  • C,take the power of 2 that higher then it

  • D.none of the above

Explicação

Questão 4 de 15

1

Any linear ordering of all of the vertives in which all the arrows go to the right that is a valid solution.

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 5 de 15

1

if doing a sequential search what is the worst case in terms of big O ?

Selecione uma das seguintes:

  • A)O(n)

  • B)O(log n)

  • C)O(1)

  • D)O(n/2)

Explicação

Questão 6 de 15

1

Under what condition would the big O for binary search be
1 + log_2(n)?

Selecione uma das seguintes:

  • a. n is not a power of two

  • b. the array is not sorted.

  • c. this would never be the big O

  • d. none of the above

Explicação

Questão 7 de 15

1

What is the worst-case number of iterations for binary search?

Selecione uma das seguintes:

  • A) O(log_2 n)

  • B) O(2 log_2 n)

  • C) O(n^2)

  • D) O(n)

Explicação

Questão 8 de 15

1

Sequential(Linear) search may be more suited to keep the array sorted if the user inserts more items than searching for them.

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 9 de 15

1

What is the worst case for a sequential search?

Selecione uma das seguintes:

  • A. O(N^2)

  • B. O(N)

  • C. O(N/2)

  • D. O(logN)

Explicação

Questão 10 de 15

1

What is a sequential search?

Selecione uma das seguintes:

  • A) A search that loops through a list and stops if the item is found

  • B) Using a sorted array, a search that iteratively divides the search partition in half. It looks at the middle element and has three scenarios.

  • C) None of the above.

Explicação

Questão 11 de 15

1

The worst case for the second algorithm shown during the case study video is:

Selecione uma das seguintes:

  • A. O(n)

  • B. O(n log n)

  • C. O(log n)

  • D. O(n^2)

Explicação

Questão 12 de 15

1

Which is true of a sequential search and a binary search?

Selecione uma das seguintes:

  • A. A sequential search needs to be sorted and a binary search does not need to be sorted.

  • B. A sequential search does not need to be sorted and a binary search needs to be sorted.

  • C. Both sequential and binary searches need to be sorted.

  • D. Neither a sequential nor a binary search needs to be sorted.

Explicação

Questão 13 de 15

1

When dealing with smaller numbers of n sequential searching and binary search do not have much difference with growth rate. It is until n gets into the 1000’s that the difference becomes greater.

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 14 de 15

1

The following description of sequential search is T/F ?

sequential search:
loops through a list and stops if the item is found

worst-case is O ( N )
average-case is O ( N/2 ) = O ( N )
best case is O ( 1 )

Selecione uma das opções:

  • VERDADEIRO
  • FALSO

Explicação

Questão 15 de 15

1

If you have a sorted array, which searching alogrithm is better binary or sequential?

Selecione uma das seguintes:

  • Sequential

  • Binary

Explicação