CS 2114 Reading Quiz 4
If an algorithm requires 7 basic operations for an algorithm with a problem size of n, the algorithmic complexity is: a) O(1) b) O(7) c) O(n) d) O(7n)
a) O(1)
What is the time complexity for adding an entry to a fixed-size array-based bag ADT? a) O(1) b) O(n) c) O(n^2) d) negligible
a) O(1)
What is the time complexity for adding an entry to a linked-based bag ADT? a) O(1) b) O(n) c) O(n^2) d) negligible
a) O(1)
For large values of n which statement is true? a) (n^2 + n ) / 2 behaves like n b) (n^2 + n ) / 2 behaves like n^2 c) (n^2 + n ) / 2 behaves like n/2 d) all of the above
b) (n^2 + n ) / 2 behaves like n^2
What is the worst-case time complexity for searching a linked-based bag ADT for a particular entry? a) O(1) b) O(n) c) O(n^2) d) negligible
b) O(n)
An algorithm has: a) time requirements b) space requirements c) a & b d) none of the above
c) a & b
You should express the complexity of an algorithm in terms of it: a) space requirements b) execution time c) problem size d) overall complexity
c) problem size
Problem size is defined as: a) the amount of memory an algorithms uses b) the amount of execution time an algorithm takes c) the number of items an algorithms processes d) none of the above
c) the number of items an algorithms processes