This page requires JavaScript, which you
don't seem to have. Please try a different browser.

Scroll through the page to review your answers. The correct answer is
highlighted in
green.
Your incorrect answers (if any) are highlighted in
red.
If you'd like to take the test over again, click the reset button at the end of the test.

Define the cost of an algorithm.

(A)
The cost of an algorithm is how much money a programmer
requires to program it.

(B)
The cost of an algorithm is the amount of money spent on a
computer to run the algorithm.

(C)
The cost of an algorithm is how much computing power and time
it takes the algorithm to run.

(D)
The cost of an algorithm is measured by Hz.

True or false: Different implementations of the same algorithm
can lead to different efficiency measures.

(A)
True

(B)
False

True or false: Different platforms running the same algorithm
always take the same amount of time.

(A)
False

(B)
True

True or false: If an algorithm is run on two very different
platforms, it may have a different
O()
efficiency.

(A)
False

(B)
True

True or false: the data structure a programmer uses in an
algorithm can have an effect on an algorithm's efficiency.

(A)
False

(B)
True

Define the real running time of an algorithm.

(A)
The real running time of an algorithm is the time it takes in
some real unit of measurement, such as seconds, for the
algorithm to run.

(B)
The real running time is a count of the number of abstract
steps performed in an execution of the algorithm, or a count
some significant operations performed, such as comparisons,
multiplications, copies, etc.

The efficiency and complexity of an algorithm are measured in
____ because it allows for easy comparisons of similar
algorithms.

(A)
KHz

(B)
Abstract time

(C)
Real running time

(D)
Carrots

If a function required
10n^{2} +24n^{3} +12(nlogn) + 2^{n}
steps to run, what would its big-O notation be?

(A)
O(n^{2})

(B)
O(n^{3})

(C)
O(24n^{3})

(D)
O(2^{n})

If a function required
5/n + 12/n^{3} + 100/(nlogn)
steps to
run, what would its big-O notation be?

(A)
O(1/n)

(B)
O(1/n^{3})

(C)
O(12/n^{3})

(D)
O(1/(nlogn)

The process of determining the rate of growth of a function is
called:

(A)
Growth analysis

(B)
Cycles

(C)
Asymptotic analysis

(D)
Symbiotic analysis

True or false:
O(nlogn) < = O(nloglogn)

(A)
True

(B)
False

True or false: If
n > m
,
O(n^{m}) < = O(m^{n})
.

(A)
True

(B)
False

O(c^{n})
is referred to as:

(A)
Exponential time

(B)
Polynomial time

(C)
Factorial time

(D)
Logarythmic time

True or false: When comparing two functions, we focus on the
limit of the function as
n
approaches 0.

(A)
True

(B)
False

Word processors often have a "find" function that allows you to
search for a word in your text. If the application uses the
data as is (i.e. doesn't put it into any sort of new data
structure), what search algorithm or structure does it most
likely use?

(A)
binary search

(B)
linear search

(C)
hash table

(D)
None of the above

True or false: linear search requires a data set to be sorted.

(A)
True

(B)
False

True or false: Given
n
pieces of data, the best we can do to
search it is
O(n)
.

(A)
True

(B)
False

True or false: Searching is an important topic in computer
science, and new algorithms for it are being devised all the
time.

(A)
True

(B)
False

True or false: Linked lists are often searched with a modified
binary search method.

(A)
True

(B)
False

True or false: Most people look up a name in a phonebook with a
modified linear search algorithm

(A)
True

(B)
False

True or false: The mailman finds your house using a binary
search method.

(A)
False

(B)
True

Binary search requires data to be in what order?

(A)
Increasing

(B)
Decreasing

(C)
Random

(D)
Sorted

True or false: Linked lists allow for random access.

(A)
True

(B)
False

True or false: Arrays allow for random access.

(A)
True

(B)
False

True or false: When doing a linear search, every element in the
array or list is always examined.

(A)
True

(B)
False

True or false: When doing a binary search, every element in the
array or tree is examined.

(A)
True

(B)
False

True or false: A doubly-linked list would allow for random
access whereas a singly-linked list wouldn't.

(A)
True

(B)
False

If you were going to implement a spell checker, which of the
following structures might you allocate to hold the words best?

(A)
Binary tree

(B)
Linked list

(C)
Hash table

(D)
Stack

A reversible function is one where for
h(x) = y
and
h^{-}1(y) = x
. True or false: a hash function is always a reversible
function.

(A)
True

(B)
False

A deletion operation when using linear probing to handle
collisions is:

(A)
O(n)

(B)
O(logn)

(C)
O(1)

(D)
O(nlogn)

True or false: A hash function can only have one input.

(A)
True

(B)
False

True or false: A hash function usually returns a non-negative
integer.

(A)
True

(B)
False

Which of the following rules does NOT make for a good hash function?

(A)
The hash function uses all the input data.

(B)
The hash value is fully determined by the data being hashed.

(C)
The hash function will generate similar hash values for similar
strings.

(D)
The hash function "uniformly" distributes the data across the
entire set of p ossible hash values.

True or false: Brute-force string searching and Rabin-Karp
string searching are the only known ways to look for a string
within another string.

(A)
True

(B)
False

True or false: Binary search would not be considered a
brute-force searching method.

(A)
True

(B)
False

True or false: Rabin-Karp works because two strings can never
hash to the same value.

(A)
True

(B)
False

True or false: Fingerprinting is a method that often uses hash
functions.

(A)
True

(B)
False

True or false: There are cases where Rabin-Karp string searching is
actually worse than brute-force string searching.

(A)
True

(B)
False

In modular arithemetic,
(amodb + c)modb
, is the same as:

(A)
(a + c)modb

(B)
(a + b)modc

(C)
(a*b)modc

(D)
(a*c)modb

True or false: Rabin-Karp string search is always
O(M + N)
.

(A)
True

(B)
False

Using knowledge you have to throw away a portion of your data
set while continuing to search the rest is a technique used in:

(A)
Linear searching

(B)
Binary searching

(C)
Hash tables

(D)
Brute-force string searching

Given the following hash function:

int hash(char* str)
{
int sum = 0;
while (*str != '\0') sum += (int) *str++;
return sum % 1;
}

the strings "This is a great SparkNote." and "I can't believe
I've been wasting my time with textbooks." both hash to the
same value.

(A)
True

(B)
False

A algorithm that is
O(1)
could run slower than which of the
following:

(A)
O(n)

(B)
O(n^{2})

(C)
Both of the above.

(D)
Neither of the above.

True or false: A linked list would also be a good way to store
a hash table.

(A)
True

(B)
False

True or false: The ideas behind a hash table require that the data
structure used have random access capabilities.

(A)
True

(B)
False

When thoroughly reading this SparkNote, the method you use for
going through it most closely resembles which search?

(A)
Linear search

(B)
Binary search

(C)
Hash table lookup

(D)
Brute-force string search

(E)
Rabin-Karp string search

True or false: A binary search requires a binary search
tree as the data structure being search.

(A)
True

(B)
False

A hash table lookup on a well implemented hash table using separate
chainging can result in which of the following access efficiencies?

(A)
O(1)

(B)
O(n)

(C)
Both of the above.

(D)
Neither of the above.

True or false: After reading this guide, you're now an expert
on basic searching methods.