MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/fjk6u1/sort_algorithm/fkp6s1f/?context=3
r/ProgrammerHumor • u/Hamstorian • Mar 16 '20
614 comments sorted by
View all comments
3.8k
If she's doing bucket sort at this age, then she's set.
776 u/SharkLaunch Mar 16 '20 But sets are unordered 2 u/Botahamec Mar 16 '20 edited Mar 17 '20 They're sorted by hashcodeEdit: It's actually sorted by the value of (hashcode % set.size) 2 u/SharkLaunch Mar 16 '20 In most (sane) implementations, they're organized not directly by hashcode, but by bucket based on the modulus of the hash code value by the size of the set. → More replies (1)
776
But sets are unordered
2 u/Botahamec Mar 16 '20 edited Mar 17 '20 They're sorted by hashcodeEdit: It's actually sorted by the value of (hashcode % set.size) 2 u/SharkLaunch Mar 16 '20 In most (sane) implementations, they're organized not directly by hashcode, but by bucket based on the modulus of the hash code value by the size of the set. → More replies (1)
2
They're sorted by hashcode
Edit: It's actually sorted by the value of (hashcode % set.size)
2 u/SharkLaunch Mar 16 '20 In most (sane) implementations, they're organized not directly by hashcode, but by bucket based on the modulus of the hash code value by the size of the set. → More replies (1)
In most (sane) implementations, they're organized not directly by hashcode, but by bucket based on the modulus of the hash code value by the size of the set.
→ More replies (1)
3.8k
u/theeggman84 Mar 16 '20
If she's doing bucket sort at this age, then she's set.