3 ms·
typically the n refers to the length of the input. bigger numbers to compare gets cancelled out by the largerness of n.
by ouid 7y ago
typically the n refers to the length of the input. bigger numbers to compare gets cancelled out by the largerness of n.
- baddox 7y agoI don’t think that’s accurate. The length of a collection is not necessarily correlated to the largeness of its largest element. The n in comparison sort is indeed the length of the collection, and that’s the only variable we generally discuss because we generally assume some fixed maximum allowable element.
- ouid 7y agoI am referring to the bit length of the input.