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).

Answered by Diana G. Computing tutor

1370 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Explain the difference between lossless and lossy data compression techniques.


Explain a bubble sort. You may use pseudocode and/or diagrams to help demonstrate your answer.


Describe a stack data structure.


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


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo
Cookie Preferences