What is the order of these functions by growth rate?
2/N,37,2N,N log(N2),N2 -
ANSWER :
2/N< 37<N log(N2) <N2<2N
How many elements will be compared to linear search for 27 in this list?
[9,3,7,2,8,15,13,35,95,7,4] -
ANSWER :
11
What is the first element visited in this list when binary searching for the number 7?
[6,7,8,9,11,15,20] -
ANSWER :
9
How many elements in a list of size 64 would be visited when using a binary search for a
number that is larger than all the values in the list? -
ANSWER :
6
How many elements in a list of size 64 would be visited when using a binary search for a
number that is smaller than all the values in the list? -
ANSWER :
6
1
, What is the runtime complexity of the algorithm O(N^N + 1)? -
ANSWER :
Exponential
What is the runtime complexity for the expression 305 + O(325*N)? -
ANSWER :
O(N)
What is the runtime complexity for this code?
for x in range(N):
for y in range(N):
for z in range(N):
tot = tot + z
print tot -
ANSWER :
O(N^3)
Which term describes an abstract data type (ADT) that Python uses? -
ANSWER :
Array
Which abstract data type (ADT) is characterized by the LIFO (last in, first out) principle? -
ANSWER :
Stack
Which queue operation removes an item from the front of the queue? -
2
2/N,37,2N,N log(N2),N2 -
ANSWER :
2/N< 37<N log(N2) <N2<2N
How many elements will be compared to linear search for 27 in this list?
[9,3,7,2,8,15,13,35,95,7,4] -
ANSWER :
11
What is the first element visited in this list when binary searching for the number 7?
[6,7,8,9,11,15,20] -
ANSWER :
9
How many elements in a list of size 64 would be visited when using a binary search for a
number that is larger than all the values in the list? -
ANSWER :
6
How many elements in a list of size 64 would be visited when using a binary search for a
number that is smaller than all the values in the list? -
ANSWER :
6
1
, What is the runtime complexity of the algorithm O(N^N + 1)? -
ANSWER :
Exponential
What is the runtime complexity for the expression 305 + O(325*N)? -
ANSWER :
O(N)
What is the runtime complexity for this code?
for x in range(N):
for y in range(N):
for z in range(N):
tot = tot + z
print tot -
ANSWER :
O(N^3)
Which term describes an abstract data type (ADT) that Python uses? -
ANSWER :
Array
Which abstract data type (ADT) is characterized by the LIFO (last in, first out) principle? -
ANSWER :
Stack
Which queue operation removes an item from the front of the queue? -
2