3 ms·
It's the number of bits. You can change to bytes, but you are just hiding another constant factor of 8 by doing that.
by ggggtez 8y ago
It's the number of bits. You can change to bytes, but you are just hiding another constant factor of 8 by doing that.
- swiftcoder 8y agoIf you have a theoretical computer with single-bit registers, sure. Quicksort is also quite slow on such an computer.
- kjeetgill 8y agoAnd this is why O() notation drops constants. 0(bits) or O(bits/8) aka bytes are the same thing. It's also worth pointing out that in standard comparison sorts, the comparison itself is technically linear to radix too, but is treated as constant. I get why it's dropped but it's worth knowing.
- ggggtez 8y agoExactly. You can try to compare two bytes, but really you are comparing 8 bits, if you thought about it algorithmically. Maybe those steps are 100% parallel. But it's irrelevant to the big O. You are measuring number of steps, and it's intended to be hardware independent.
- ggggtez 8y agoBig O is hardware independent.