VeriskOA #3
MCQ Questions
估计简单概念题评测数据准备中,可先阅读题面
考点(AI 标注)原地数组SQL
Q1: Big-O notation definition
Big(O) notation:
- (A) identifies the best algorithm to solve a problem.
- (B) determines maximum size of a problem that can be solved on a system in a given time.
- (C) is the lower bound of the growth rate of an algorithm.
- (D) is the upper bound of the growth rate of an algorithm.
- (E) None of the above.
Answer: D. Big-O describes an asymptotic upper bound of the growth rate; Big-Omega is the lower bound, Big-Theta is tight.
Q2: Quicksort partition pivot index
Given array [76, 97, 25, 115, 83, 51, 18, 36], quicksort with the first element (76) as pivot. After one Lomuto/Hoare partition, what is the 1-indexed position of the pivot?
- (A) 1
- (B) 3
- (C) 5
- (D) 4
Answer: C (5). Elements less than 76 are 25, 51, 18, 36 (4 elements). After partition, 76 sits at index 5 (1-indexed) with the 4 smaller values to its left and 97, 115, 83 to its right.
Q3: SQL IN syntax
Pick the expression with the correct syntax.
- (A)
SELECT * FROM logs WHERE priority IN ('high', 'medium') - (B)
SELECT * FROM logs WHERE priority VALUES IN ('high', 'medium') - (C)
SELECT * FROM logs WHERE priority IN VALUES ('high', 'medium') - (D)
SELECT * FROM logs WHERE priority IN SET ('high', 'medium')
Answer: A. Standard SQL IN takes a parenthesized value list directly; VALUES / SET keywords are not valid here.