🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Searching and Sorting in C: all 10 questions

Quiz: Searching and Sorting in C · Question 1 of 10

What must be true before you can use binary search?

What must be true before you can use binary search?

  1. A.The array must have an even number of elements
  2. B.The array must be sorted
  3. C.The array must contain no negative numbers
  4. D.The array must be stored on the heap
Answer & explanation

Correct answer: The array must be sorted

Binary search decides which half to discard by comparing with the middle; this only works on sorted data.

Can you get the rest right without peeking?

Take the timed Quiz: Searching and Sorting in C quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →