Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
Which of the following search algorithms will work on unsorted data? a. Sequential search b. Both of these will work c. Binary...Question
Which of the following search algorithms will work on unsorted data?
a.
Sequential search
b.
Neither of these will work
c.
Binary search
d.
Both of these will workK
a.
Sequential search
b.
Neither of these will work
c.
Binary search
d.
Both of these will workK
Answers
Answer
Which of the following best describes the looping structure of a sequential search?
a.
Nested for loops
b.
A series of if statements
c.
A single for loop
d.
An outer while loop and an inner for loop
a.
Nested for loops
b.
A series of if statements
c.
A single for loop
d.
An outer while loop and an inner for loop
Answer
If there are "N" elements in a list, which of the following best describes the average time it takes for the sequential search to find a value in that list?
a.
N2 (N-squared)
b.
N
c.
log2(N) (logarithmic)
d.
N / 2
a.
N2 (N-squared)
b.
N
c.
log2(N) (logarithmic)
d.
N / 2
Answer
How does the binary search get better performance than the sequential search on an ordered list?
a.
The binary search is written in machine code for the greatest speed on any CPU
b.
The binary and sequential searches actually perform about the same on sorted data
c.
The binary search relies on more efficient list access using a numeric index
d.
The binary search discards half of the possible elements after each comparison
a.
The binary search is written in machine code for the greatest speed on any CPU
b.
The binary and sequential searches actually perform about the same on sorted data
c.
The binary search relies on more efficient list access using a numeric index
d.
The binary search discards half of the possible elements after each comparison
Answer
On each iteration, within a specific range, what element does the binary search select for comparison to the target value?
a.
The middle element
b.
The right-most element
c.
A random element
d.
The left-most element
a.
The middle element
b.
The right-most element
c.
A random element
d.
The left-most element
Answer
If there are "N" elements in a list, which of the following best describes the average time it takes for the sequential search to find a value in that list?
a.
N2 (N-squared)
b.
N
c.
log2(N) (logarithmic)
d.
N / 2
a.
N2 (N-squared)
b.
N
c.
log2(N) (logarithmic)
d.
N / 2
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.