Article directory
1. multiple choice
(1) When performing sequential search on a table of n elements, if the probability of finding each element is the same, the average search length is ( ).
A. (n-1)/2
B . n/2
C. (n+1)/2
D . n
Answer: C
Explanation: The total number of searches N=1+2+3+ , +n=n(n+1)/2 , then the average search length is N/n=(n+1)/2 .
(2) The storage method and element arrangement requirements of the table suitable for split-half lookup are ( ).
A. Linked storage, unordered elements
B. Linked storage, elements are ordered
C. Stored in order, the elements are unordered
D. Sequential storage, elements are ordered
Answer: D
Explanation: The halved search requires that the linear table must adopt a sequential storage structure, and the elements in the table are arranged in order by keywords.
( 3