Comment on Programmer tries to explain binary search to the police
starman2112@sh.itjust.works 1 year agoIf you skip to after the smoke has dissipated, you cannot gather enough information to know that you need to rewind. A binary search is useless in this scenario.
CosmicCleric@lemmy.world 1 year ago
Depends on how long the smoke remains in the air.
starman2112@sh.itjust.works 1 year ago
If it’s not “for the duration of the rest of the video,” then binary search would be useless
CosmicCleric@lemmy.world 1 year ago
That’s not true. It only has to be long enough to be detectable, by landing on a strip of video that it exists on. It’ll be harder, definately, but still doable.
starman2112@sh.itjust.works 1 year ago
Maybe I have no understanding of what a binary search is. My understanding is that you check halfway through the video, see if the thing has happened yet, then skip halfway to the end if it hasn’t. Check again, skip again. When you see the cue that the event has happened, you rewind to halfway between the latest point where the event hadn’t happened yet and the earliest point when it has. Keep doing that and you can pinpoint the exact frame where the event happens in a matter of minutes.
Binary search would be largely useless in cases where you have a good chance of skipping right past the event. If the video is an hour long, and the event happens 34 minutes in and leaves a visual cue that lasts less than 11 minutes, then binary search does not find the event. At that point, watching the video fast forwarded would be the way to go, and that’s not a binary search, that’s just watching the video.