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
Answered by Diana G. Computing tutor

1770 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Explain how a stack could be used in the process of evaluating an expression in Reverse Polish notation.


Some problems are intractable. What does it mean for a problem to be described as intractable?


Explain why it is important to check the email address with JavaScript and again when it reaches the server.


Describe the difference between passing parameters into a function by reference and by value? Indicating how this may lead to unexpected outputs.


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

MyTutor is part of the IXL family of brands:

© 2026 by IXL Learning