Question: What value is k set to after the pseudocode executes?
Answer Choices:
A. 0
B. 1
C. 2
D. 5
Answer: D – 5
Question: Which statement describes the runtime efficiency of f(n) {k = 0 for i = 1 to n { for j = 1 to n { k = k + 1 }} return k}?
Answer Choices:
A. O(log n)
B. O(n log n)
C. O(n)
D. O(n²)
Answer: D – O(n²)
Question: What is the worst-case time complexity for this algorithm?
Answer Choices:
A. O(1)
B. O(n)
C. O(n²)
D. O(n³)
Answer: C – O(n²)
Question: Which routine will require the most computer operations to calculate the average of the values in the data set?
Answer Choices:
A. SUM(DATA) × N
B. SUM(DATA ÷ COUNT(DATA))
C. SUM(DATA) + COUNT(DATA)
D. SUM(DATA) + N
Answer: B – SUM(DATA ÷ COUNT(DATA))
Question: What is the worst-case scenario when performing a linear search for a specific value?
Answer Choices:
A. Looking for 2
B. Looking for 500
C. Looking for 999
D. Looking for 1,200
Answer: D – Looking for 1,200
Question: What is the big-O of an algorithm that always executes at a constant time?
Answer Choices:
A. O(0)
B. O(1)
C. O(n)
D. O(n²)
Answer: B – O(1)
Question: How many times is the value of the variable count changed?
Answer Choices:
A. 16
B. 5
C. 3
D. 2
Answer: C – 3
Question: What is the worst-case scenario when performing a linear search for a specific value?
Answer Choices:
Looking for 2
Looking for 500
Looking for 999
Looking for 1,200
Answer: Looking for 1,200
Question: What is the O of a Θ(n³) algorithm?
Answer Choices:
A. O(n)
B. O(n⁴)
C. O(2n)
D. O(2n²)
Answer: B – O(n⁴)
Question: Which number has a multiplicative inverse mod 30?
Answer Choices:
44
55
77
99
Answer: None of these (all answers share factors with 30) — trick question, none has an inverse mod 30.
Question: Which statement is true for f(n) = 10 log(n) + 5 (log(n))³ + 7n + 3n² + 6n³?
Answer Choices:
A. f(n) is O(n²)
B. f(n) is O(log n⁵)
C. f(n) is O(n³)
D. f(n) is O(log n)
Answer: C – f(n) is O(n³)
Question: What is the worst-case scenario of the performance of the following algorithm?
Answer Choices:
A. T(N) = N + c₁ for constant c₁
B. T(N) = c₁N² for constant c₁
C. T(N) = c₁N² + c₂N + c₃ for constant c₁, c₂, and c₃
D. T(N) = c₁N² + c₂ for constants c₁ and c₂
Answer: C – T(N) = c₁N² + c₂N + c₃
Question: What is the hexadecimal notation that corresponds to the binary notation 111010?
Answer Choices:
E8
58
3A
74
Answer: 3A
Question: In which modular arithmetic does 10 have a multiplicative inverse?
Answer Choices:
Mod 15
Mod 13
Mod 12
Mod 14
Answer: Mod 13
Question: What is (0110 1101 1010 0111)₂ in hexadecimal form?
Answer Choices:
5DB6
6DB6
6DA7
7DA7
Answer: 6DA7
Question: What is the binary equivalent of (B5)₁₆?
Answer Choices:
0101 1011
1100 0101
1100 1010
1011 0101
Answer: 1011 0101