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 ▸

Describe what is meant by a modular design and state on advantage of a modular design.


Calculate -3 + 3 using Two's Complement and the Sign and Magnitude Method. Which works correctly?


What is the point of an Operating System?


The numbers 6B and 12 are displayed in hexadecimal form. Convert them into binary form and perform binary addition to find the sum. Convert your answer back into hexadecimal. Show your workings.