Re:Sleeping Through the Technical Interview (2022)
by fenomas on Saturday July 08, 2023 @01:21AM
(#36641565)
You're forgetting that complexity analysis deals with asymptotic behavior.
An algorithm that takes N inputs, does N operations, and then sleeps for 10 seconds is not constant time, because in the asymptotic case the N iterations will take longer than the sleep.
An algorithm that takes N inputs, does N operations, and then sleeps for 10 seconds is not constant time, because in the asymptotic case the N iterations will take longer than the sleep.