Given an unlimited number of light bulbs (that break at a certain height), and a building with 100 floors, how do you determine the height that the light bulb breaks?

The solution is a binary search algorithm (where you start on floor 50th and move up or down depending if the bulb breaks or not, always picking the middle floor of your option range).

DG

Related Computing A Level answers

All answers ▸

Explain indexed addressing including the benefits when traversing certain data structures (4 Marks)


Outline the differences between how a compiler and an interpreter works, and explain the advantages and usage of of each [12 marks]


What is Reverse Polish Notation?


Write a Pseudocode function that returns the factorial of an integer input.