Filters
Question type

Study Flashcards

A binary search is necessary for data that are not arranged in any particular order.

A) True
B) False

Correct Answer

verifed

verified

Python's in operator is implemented as a method by what name in the list class?


A) __in__
B) __contains__
C) __present__
D) __within__

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

Bubble sort's worst-case behavior for exchanges is greater than linear.

A) True
B) False

Correct Answer

verifed

verified

The process of determining the running time and memory cost of an algorithm by reading the code and creating a mathematical formula expressing this cost is known by what term?


A) pattern analysis
B) complexity analysis
C) cost analysis
D) micro analysis

E) C) and D)
F) All of the above

Correct Answer

verifed

verified

In general, we worry more about average and best-case performances than about worst-case performances.

A) True
B) False

Correct Answer

verifed

verified

Sequential search is also called polynomial search.

A) True
B) False

Correct Answer

verifed

verified

What statement accurately describes the strategy utilized by the bubble sort algorithm?


A) The bubble sort algorithm repeatedly swaps elements that are out of order in a list until they are completely sorted.
B) The bubble sort algorithm repeatedly swaps the smallest element in an unsorted portion of a list with an element at the start of the unsorted portion.
C) The bubble sort algorithm repeatedly inserts the i-th element into its proper place in the first i items in the list.
D) The bubble sort algorithm partitions a list around a pivot item and sorts the resulting sublists.

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

Some algorithms require more memory as the problem size gets larger.

A) True
B) False

Correct Answer

verifed

verified

Algorithms with linear behavior do less work than algorithms with quadratic behavior for most problem sizes n.

A) True
B) False

Correct Answer

verifed

verified

An algorithm coded in Python usually runs slightly faster than the same algorithm coded in C.

A) True
B) False

Correct Answer

verifed

verified

The constant of proportionality involves the terms and coefficients that are usually ignored during big-O analysis.

A) True
B) False

Correct Answer

verifed

verified

What are the two major problems with the benchmark technique of measuring algorithm efficiency?


A) Different hardware platforms have different processing speeds, meaning the running times will differ.
B) A benchmark test does not account for differences in the size of data sets.
C) The test cannot be performed without modifying the code for which the benchmark will be performed on.
D) It can be impractical to determine the running time for algorithms with very large data sets.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

What statement accurately describes the strategy utilized by the insertion sort algorithm?


A) The insertion sort algorithm repeatedly swaps elements that are out of order in a list until they are completely sorted.
B) The insertion sort algorithm repeatedly swaps the smallest element in an unsorted portion of a list with an element at the start of the unsorted portion.
C) The insertion sort algorithm repeatedly inserts the i-th element into its proper place in the first i items in the list.
D) The insertion sort algorithm partitions a list around a pivot item and sorts the resulting sublists.

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

The time() function of the time module can be used to track the running time of a program.

A) True
B) False

Correct Answer

verifed

verified

The first two numbers in the Fibonacci sequence are 1 and 2.

A) True
B) False

Correct Answer

verifed

verified

What is NOT one of the three Python functions that are associated with the merge sort algorithm?


A) mergeSort
B) mergeSortHelper
C) merge
D) mergeSplit

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

Algorithms describe processes that run on real computers with finite resources.

A) True
B) False

Correct Answer

verifed

verified

Whenever the amount of work of an algorithm is expressed as a polynomial, we focus on one term as dominant.

A) True
B) False

Correct Answer

verifed

verified

When you count instructions to estimate the efficiency of an algorithm, you count the instructions in the executable machine language program.

A) True
B) False

Correct Answer

verifed

verified

What programming technique involves saving intermediate values when they are computed so they can be reused when they are needed again?


A) memoization
B) prioritization
C) amortization
D) memorization

E) B) and D)
F) B) and C)

Correct Answer

verifed

verified

Showing 21 - 40 of 51

Related Exams

Show Answer