hobune Channels Contact About Donate

What is a HashSet?

Back to video page | Download comments jsonl

Comments (archived 2022-07-01 18:19; 29 top, 44 total comments)

aquila zyy 2019-06-23 21:51:08 (edited 2019-06-23 21:53:07 )

Really refreshed my memories on these concepts. How about doing some analysis on real minecraft classes’ codes sometime? That will certainly makes the purpose of using hashset in minecraft even clearer.

5 likes
Rays Works 2019-06-20 11:34:29

Packed full of great info, well done!

26 likes
Replies (2)
Li3 2019-06-29 17:42:00

Rays Works I see you on every minecraft video

3 likes
InDestructibleMC 2020-11-01 22:40:43

@Li3 he watches them but he doesnt seem to learn anything. or at least clicks on the video and comments

4 likes
Nooticus 2019-06-21 17:38:17

Very clear explanation! I'm interested to see the next videos to see how it influences minecraft stuff!

4 likes
Vivien Lynn 2020-12-08 16:54:18

Wow, great explanation! Thank you very much for doing this video!

1 like
mu116688 2020-09-07 21:22:49

Great video! Just wanna add a little bit more details as I'm bored. Haha.

In most cases, hashtables/hashmaps are initialized with the number of slots being a prime. Using composite numbers as slot count is commonly avoided, and I've read books that recommend avoiding powers of 2 at all cost unless certain special algorithm is required and implemented. Doing so is usually the best way to minimize the probability of collisions since modulo is used as array indices. Since traversing through a linked list requires extra computational time, it's crucial to keep the collision rate as low as possible. (Chaining is often the best collision resolving method as others, especially probe sequencing, require some extra codes to deal with collided items even after one of them already being removed.)

BTW your works are amazing! I just subbed. c:

2 likes
Google plexian 2020-09-12 08:57:04

Thanks, I finally know what hashing and a Hashset is. You have shown me the start of a VERY deep Rabbit hole.

I think this was a good explanation for me and others, which came on contact with programming, bit I think it is not a good video for People who never Programmed befor. The examples where you computed the index for the Hashset manually was a little exhausting, bit nevertheless, Thanks, I learned something new

1 like
nobody literally 2019-06-23 05:35:06

Data structure lessons in a Minecraft channel!

23 likes
Emularis 2021-09-24 07:56:11

Beautiful explanation. Thanks.

0 likes
FaRo 2021-03-04 23:04:57

22:31 Usually it's bottom left, middle left, top left, the right one below that, then the root node and the same order on the other half. If you insert ascending numbers in that order into it, you can always go left for lower numbers and right for higher numbers. For example, if you insert 123456789 and then search for a 6, then you first see the root node 5, go right, you see 8, go left, 7, go left, 6.

0 likes
Replies (1)
Earthcomputer 2021-03-05 13:48:53

That is true for sorted sets, however in hash sets there is no particular requirement on the iteration order, so they went for this weird linked structure for the iteration order, and the linking order is different depending on whether a node was added via treeification or added after the tree was formed, and differently again once nodes are removed. All that is a very long way of saying that I judged that order to be too complicated for this video, and in tech mc we don't tend to rely on treeified ordering anyway because of how volatile it is.

1 like
FaRo 2021-03-04 22:42:55

4:20 Actually actually, your original statement was correct. For example in Java, you can iterate over all the entries in the map, which are these pairs of key+value. So a map is indeed a set of pairs.

0 likes
Replies (2)
Earthcomputer 2021-03-04 22:55:05

Internally it's the other way around, the public API misleads ;)

0 likes
FaRo 2021-03-04 23:05:59

@Earthcomputer That's weird. Wouldn't it be more efficient to not have tons of null values?

0 likes
Nitrousoxide 2020-05-24 22:41:33

Great video but I think you should've included some of the big Os

0 likes
bean noodle 2019-11-12 22:57:42

12:14 places it in square? #2. Starting from 1, it gets put in the third box. However, the box's counting starts from 0. Some people might assume it starts from one and be confused

0 likes
Replies (1)
Earthcomputer 2019-11-13 17:22:47

It may be more confusing if you're not used to 0-indexing, but the modulus operator outputs a value from 0 to (n-1), not from 1 to n, so it makes more sense this way.

1 like
Nekzuris 2019-06-20 13:33:13

Very interesting video thanks!

1 like
GMOHeaven 2019-06-20 14:00:28

"Sets are maps with null values"

This seems weird to me. Why waste the memory? Is there a reason or was it just easier to implement this way (i.e. lazy/smart devs)?

2 likes
Replies (1)
kaitlyn tw 2019-06-26 05:44:07

Set elements "hash" to a specific index in a collection. It's said that the elements are "null" because they don't actually exist in the collection, they're just "marked" as existing or not. It's useful to NOT store them since it SAVES memory. The purpose of a set is not to keep track of values, but to keep track of a value's existence in a collection.

To answer your second question, Java has their own implementation of a HashSet that Minecraft uses, so it it's really about the Java maintainers' decision, not the devs. Not really lazy or smart, just the most common way to do it

5 likes
kikawet 2019-06-20 11:51:28

Congratulations! You deserve it! :D
Very interesting video!

no really, it was good video xd

14 likes
RutilantBossi TV 2019-07-17 04:23:09 (edited 2019-07-17 04:23:36 )

Cool i'm the 2000th subscriber


You're to redstone engineers what redstone engineers are to the rest of us ! Best mind that ever played Minecraft !

0 likes
Force Ken 2019-08-01 06:39:47

how do you only have 2k subs? O_O you're pretty much legendary on 2b2t. Great videos!

1 like
Replies (3)
TheDutchisGaming 2019-09-10 21:18:43

Why is he legendary on 2b2t?

0 likes
Force Ken 2019-09-10 21:29:01

@TheDutchisGaming he leaked the book dupe glitch, well he was the first source of the program.

1 like
Force Ken 2019-09-10 21:32:00

also, the "unbreakable'' items scourge we are currently in, we can thank him for ;)

0 likes
Matthew Bolan 2019-06-20 10:52:44

I heard that you invented the hashset

11 likes
Replies (1)
Nooticus 2019-06-21 17:36:48

Lol

0 likes
MaJEllico 2019-06-20 19:02:30

"EA, you owe I"
Orf EA shill confirmed

3 likes
Sped 2019-06-20 23:39:38

This duplication glitch is very complicated and confusing

0 likes
Replies (2)
ahgqw bassdd 2019-08-01 10:19:39

It's not and go comment on that video, not this

0 likes
InDestructibleMC 2020-11-01 22:42:08

@ahgqw bassdd its a joke go take your salt elsewhere

0 likes
Jendrik Weise 2019-06-20 13:02:20

you could have probably just linked to some computer science channels video on hash sets and maps, couldnt you? xD

1 like
Replies (1)
Earthcomputer 2019-06-20 13:08:49

Maybe, but the next video will be more in depth and I dont think there are any computer science vidoes that go that in depth on the java data structures in particular

5 likes
_Kayleigh 2019-06-20 10:55:15

hElP dTtS brOKe MY moBsWITch

7 likes
Varun Chawla 2021-08-18 00:39:51

len(hello) is 5 not 4 so *****86%5 == 1 right?

0 likes
RR_Minecraft 2019-06-20 14:52:39

Very technical and useful for bedrock speedrun

3 likes
Replies (1)
RandomSnow ' 2020-08-03 22:40:48

Xd

0 likes
EDDxample 2019-06-20 12:13:56

\o/

4 likes
RedNicStone 2019-06-20 13:55:58

Linux! Nice...

3 likes
Pe3ak Pe3et 2020-07-17 13:47:42

hello ilmumbo!

1 like
KaptainWutax 2019-06-20 12:36:33

Wtf is this shit. Where is LongOpenHashSet. xd

2 likes
RedCMD [::] 2019-06-20 11:06:19

Hello allo

2 likes