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 the difference between a CPU and a GPU with relation to processing power and ability to perform tasks.


What do I need to know about operating systems?


What are the benefits of using thin clients.


A common construct found in many algorithms is a loop. Using pseudocode, write a pre-condition loop to output all of the even numbers between 99 and 201.