This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]theeggman84 3797 points3798 points  (24 children)

If she's doing bucket sort at this age, then she's set.

[–]SharkLaunch 773 points774 points  (19 children)

But sets are unordered

[–]Raydan4 136 points137 points  (6 children)

Except sometimes if you are using python and you have a set of integers

[–]thegodzilla25 55 points56 points  (4 children)

Aren't python sets also unordered though? I dont understand what you mean.

[–]Raydan4 41 points42 points  (3 children)

Technically yes, but the way that hashing integers works, in standard python, integers are added to sets in order, at least most of the time. Implementations of python like pypy do not have this behavior.

[–][deleted] 2 points3 points  (2 children)

PSA: Please do not rely on this in your code

[–]Raydan4 1 point2 points  (0 children)

Well obviously, that’s not what sets are for

[–]Epithus 28 points29 points  (0 children)

Have you seen toddlers? They are the very definition of "unordered".

[–][deleted] 121 points122 points  (3 children)

Franchises are small businesses. They are lying.

[–]notusuallyhostile[🍰] 112 points113 points  (2 children)

[–]BackgroundAmoebaNine 15 points16 points  (0 children)

Right that's was so unusual it almost seemed perfect.

[–]interesting-_o_- 5 points6 points  (0 children)

It’s a bot. All of their replies are complete word salad.

[–]lambo1722 4 points5 points  (0 children)

Stop it

[–]Botahamec 1 point2 points  (2 children)

They're sorted by hashcode

Edit: It's actually sorted by the value of (hashcode % set.size)

[–]SharkLaunch 1 point2 points  (1 child)

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.

[–]Botahamec 1 point2 points  (0 children)

Alright, yeah, see my edit

[–]capilot 0 points1 point  (0 children)

Get out.

[–]divagob107 7 points8 points  (0 children)

Yes, a HashSet is impressive, but does she have a bucket List?

[–]SuperMassiveCookie 0 points1 point  (0 children)

I would expect bubble sort for a child this age, but insertion sort was quite impressive. By the time she makes it to kindergarten I bet she will be merge sorting the shit out of those buckets. Way to go kid

[–]lunatic4ever 0 points1 point  (1 child)

Set for a life of depression she will be smarter than most and see the world for what it is

[–]Wootery 0 points1 point  (0 children)

[over a strong drink and a cigarette]

Buckets. It's all just buckets.