ALGORITHMS I OBJECTIVE ASSESSMENT EXAM k k k k k
k QUESTIONS AND CORRECT DETAILED ANSWERS (EXPERT k k k k k k
VERIFIED ANSWERS) |AGRADE: GUARANTEED SUCCESS k k k k
A functions whose cost scales linearly with the
k k k k k k k k
size of the input O(n)
k k k k k
Iterating over a collection of data once often indicates an
k k k k k k k k k k
algorithm. (alphabet for- k k
loop example) O(n) k k
A functions whose cost scales logarithmically
k k k k k k
with the input size O(log n)
k k k k k
Which type of function works by breaking down large problem into s
k k k k k k k k k k k
maller and smaller chunks? O(log n)
k k k k k
As the size of the input grows the cost of the algorithm does not increase a
k k k k k k k k k k k k k k k
t the same rate. The overall cost of performing an operation on 1,000,000 i
k k k k k k k k k k k k k
tems is only twice that of performing the operation on 1,000 items.
k k k k k k k k k k k
O(log n) k
,A function that exhibits quadratic growth relat
k k k k k k
ive to the input size O(n^2)
k k k k k
,An example of this type of function is dou
k k k k k k k k
bly nested loop O(n^2)
k k k
Which type of function gets really expensi
k k k k k k
ve really quickly? O(n^2)
k k k
A function that has two inputs that contri
k k k k k k k
bute to growth O(nm)
k k k
An example of this type of function is when there is a nested loop that itera
k k k k k k k k k k k k k k k
tes of two distinct collections of data
k k k k k k
O(nm)
Are Big- k
O cases used in the best or worst situ
k k k k k k k k
ations? Worst k
, Which statement is static?
k k k
readonly Contact[] contacts = new C
k k k k k
ontact[]; readonly Contact contacts =
k k k k
new Contacts[100]; readonly Contac
k k k k
t contacts = new Contacts[100];
k k k k
A container where data is stored in nodes consisting of a single data item
k k k k k k k k k k k k k k
and a reference to the next node
k k k k k k