Binary Search (OCR A-Level Computer Science): Quizzes

📚Quizzes
Binary Search
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

12 questions from this quiz

Show

What is the essential pre-condition for Binary Search to work correctly?

The data must be sorted

What is the worst case time complexity of Binary Search?

O(logn)O(\log n)

What is the best case time complexity of Binary Search?

O(1)O(1)

What is the space complexity of the iterative Binary Search implementation?

O(1)O(1)

If the target is greater than the middle element, which half should be searched?

The right half

If the target is smaller than the middle element, which half should be searched?

The left half

What value does Binary Search return when the target is not found?

-1

What is the loop condition in iterative Binary Search?

low <= high

How is the middle index calculated in Binary Search?

(low + high) DIV 2

How does Binary Search compare to Linear Search for large datasets?

Binary Search is much faster

Why does applying Binary Search to unsorted data lead to incorrect results?

Binary Search only works on sorted data

What is the base condition for the recursive Binary Search implementation?

IF low > high

Explore OCR A-Level Computer Science Revision Notes by Topics

Explore OCR A-Level Computer Science Model Answers by Topics

Explore OCR A-Level Computer Science Flashcards by Topics

Explore OCR A-Level Computer Science Exam Questions by Topics

Join 100,000+ A-Level students studying Quizzes with us.

Select your subjects, and get access to A+ resources today.