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 ▸

What are higher order functions in functional programming? How does the 'map' function work and why is it a higher order function?


Represent the denary number 5.625 as an unsigned binary fixed point number with three bits before and five bits after the binary point.


Choose 3 types of malware, describe them and the ways in which they may harm a device.


Simplify the boolean expression ¬(A.B)+A.