Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Hexstream
· 17y ago · 0 comments
Walking would be O(n^2) for all but the shortest distances actually, I think. Unless you rested once in a while. Amortized linear time?
Comments
[–]
BeefingJection
17y ago
How do you figure?
[–]
Hexstream
OP
17y ago
Does walking continuously for 1000km merely take 100 times longer/more effort than 10km?
[–]
paulgb
17y ago
Good point, but you answered your own question: the "walk then rest" algorithm will do it in linear time.
[–]
tjpick
17y ago
null pointer on your drink-bottle instance results in fatal runtime exception.