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 how the fetch execute cycle works? Include the specific registers and buses being used


Describe the 4 layers of the TCP/IP model


Describe the operations of an optical disk drive used to read data from an optical disk, such as a CD or DVD.


What is 'Virtual Memory', and how does it work?