Search posts, tags, users, and pages
Does code length matters?
Abhinav Kumar
@ashtavakra
OnlyCodeGyan
Markdown supported · ⌘↵ to post
GirdhaR
in the worst case it would be 4 comparisons. in your example if the heaviest ball is either among ball 1,2,4 or 5 then it would take 4 comparisons to find that ball
GirdhaR
in the worst case it would be 4 comparisons. in your example if the heaviest ball is either among ball 1,2,4 or 5 then it would take 4 comparisons to find that ball