Тёмный

Hash Tables | Data Structures in JavaScript 

beiatrix
Подписаться 4,3 тыс.
Просмотров 26 тыс.
50% 1

All about hash tables & how to implement them in JavaScript. ✧˖°
Code: repl.it/@beiat...
Data Structures in Javascript Playlist: • Data Structures in Jav...
PLEASE LOVE ME:
♡ GITHUB: github.com/beia...
♡ PERSONAL: www.beiatrix.com
♡ INSTAGRAM: / beiatrix
♡ TUMBLR: / beiatrix
♡ TWITTER: / beiatrix
music:
► yt audio library - take it easy
► yt audio library - nidra in the sky with ayler
► yt audio library - open sea morning

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 79   
@devincustodio2258
@devincustodio2258 5 лет назад
Your hash collision is due to what I assume to be an unintentional bug in your hash function. Notice that the keys that resulted in the collision all ended with 'a'. That's odd. If you look inside the hash function, you'll notice that in the for loop, youre not updating hashedKey with +=, you're just reassigning it with =. This is the bug that resulted in your collisions. Keys whose last character ended in 'a' were all mapped to the same hash output.
@ebrahimmansour7606
@ebrahimmansour7606 5 лет назад
I agree with you, instead of updating the hashedKey, she reassign it, so that's cause a repeating hash keys
@praveenps1821
@praveenps1821 5 лет назад
is there a standard format for the hash function, is it possible to add some other contents inside the hashfunction, why charCodeAt??help if you can
@marccmartian
@marccmartian 4 года назад
it's right!
@NeelanshMathur
@NeelanshMathur 4 года назад
Perfect. This was the problem all along. BUT, it could also be that she was just trying to deliberately show collisions in her code. We may never know.
@jaywalker.
@jaywalker. 4 года назад
Wow, super helpful, thanks. Also, great video, beiatrix!
@charmainetabilas3132
@charmainetabilas3132 5 лет назад
this was super helpful! using the Map object was a game changer in trying to recreate them on my own
@chrisplacktor1992
@chrisplacktor1992 3 года назад
You easily explain those concepts... I m so happy to be here
@chamnil8666
@chamnil8666 4 года назад
Hey,Beiatrix,your code line 7 ,should be hashedKey += key.charCodeAt(i).
@YOLITOPINTO
@YOLITOPINTO 2 года назад
The chill bg music & the clear explanation are just ✨✨✨
@ARTICFR0ST
@ARTICFR0ST 3 года назад
this was really helpful, HashTable was an extremely difficult structure to grasp in college for me (along with graphs). But moving from java to JavaScript has made them really easy to udnerstand. thanks!
@dawnchung5234
@dawnchung5234 3 года назад
I laughed when you used "Sailor Moon" as an example here.LOL. I used to watch that anime as a child as well. Thank you for making this tutorial! Now, I have a better understanding of hash table.
@ninjarogue
@ninjarogue 3 года назад
wow i watched like three videos before this and was left even more confused than i was before, but when i watched your video somehow everything just clicked lol =D ty
@shaunataughtme2734
@shaunataughtme2734 4 года назад
Fighting evil by moon light, writing Maps by day light..... this was a great video! very concise and easy to under stand. think God for ES6
@CoryandStuff
@CoryandStuff 5 лет назад
Great video but had to edit your code on repl because the for loop in the constructor of the HashTable class had 'this.buckets.length' instead of 'i < this.buckets.length'. It's correct in your video but only that was missing in the repl code. Besides that a lot of things clicked from watching your video! You definitely explained it in a more efficient and simple manner than the other videos i've watched.
@kastikas
@kastikas 2 года назад
Even if you dont speak or understand inglish very well, i got it all ... thanks for the vid.. Saludos desde Argentina. _V
@arcosd63
@arcosd63 2 года назад
Very nice and classy. Thank you.
@lukramingo1496
@lukramingo1496 2 года назад
wow....great explanation and easy to understand quickly compare to other videos. 🥰
@TheCarlosAlfaro
@TheCarlosAlfaro 3 года назад
Super well explained! I loved it! Thank you!
@bizzle350
@bizzle350 5 лет назад
Your data structure playlist is great and appreciated! Lol the spongebob clip at the end of this video caught me off guard. It was funny. NICE lmbo! I like the use of Sailor Moon Lol. I felt like a kid again.
@MonisKhanIM
@MonisKhanIM 3 года назад
Thank u so much 💗
@geld5220
@geld5220 2 года назад
Why are you so good!? 🙃
@geld5220
@geld5220 2 года назад
can you explain how you got the hash function to start with ?
@tajapan
@tajapan 4 года назад
i think the for loop is redundant here, you can just do hashedKey = key.charCodeAt(key.length-1) when generating hash or prob you meant hashedKey += key.charCodeAt(i) ? cheers!
@MrHarumakiSensei
@MrHarumakiSensei 4 года назад
Yeah, it's the latter. She said she was doing that, but accidentally typed something else.
@TarekFaham
@TarekFaham 3 года назад
Fantastic video... Very helpful. Thank you.
@haryschampultra
@haryschampultra 2 года назад
Great!
@niyasrahman131313
@niyasrahman131313 5 лет назад
Please do more videos in js and programming
@andresj.s.3568
@andresj.s.3568 4 года назад
Unless I got it wrong, I think the downsize of Map is that, just like in an object, it will overwrite the value of a key in case the key already exists. It is kind of exceptional, because for that you should have collision, plus the same key, which is an exceptional case but it could as well happen. But for the purpose of explanation this logic is quite simple and easy to understand. For edge cases one should do ones own analysis.
@marccmartian
@marccmartian 4 года назад
Hi. good tutorial! in the link, in your code there is an error on line 17, the index of 'for' is missing for the iteration to end ... should be: for (let i = 0; i
@kwameasiago6436
@kwameasiago6436 4 года назад
Before this the mere mention of hash table gave me nightmares. Thanks
@dadonztobs
@dadonztobs 5 лет назад
Lovely explanation. Here is my observation. The collisions occurred because all keys that ends with the same character, end up having same hashes. For instance a, aba, fjha, aaaaaa, .... all have same hash value. So why is it like that?
@AntiZero0
@AntiZero0 5 лет назад
I found this to be super valuable thank you!
@JasonLayton
@JasonLayton 3 года назад
Cool, I am able to understand. Thank you.
@raba650
@raba650 3 года назад
Wow you still remember those names 😂 Is it weird that I use to watch that as we as a little boy after coming home from school? Oh well.
@ranatahirtahir9980
@ranatahirtahir9980 2 года назад
Hi Mam Awesome Video Please More video on JavaScript Api
@christalley5192
@christalley5192 4 года назад
Very well done. Thank you
@Awesoooooomeness
@Awesoooooomeness 5 лет назад
Yeeeesss this was the best video i saw on this
@dean6046
@dean6046 4 года назад
Thank you! Well explained
@ModernBrick
@ModernBrick 5 лет назад
Great tutorial! I also loved watching Sailor Moon!
@RaviKalia
@RaviKalia 5 лет назад
Really great stuff. A thought, sometimes your use of let could be replaced by const - it seems.
@Retruntobase
@Retruntobase 4 года назад
I assumed that in JS Objects like {key:value} is already implemented, and in Python it’s called ‘dictionary’. Am I right?
@Fitzpa14
@Fitzpa14 5 лет назад
I’m surprised you don’t have more subs
@eny1103
@eny1103 5 лет назад
You are my savior. I love you XD
@CYBERSTEFFIE
@CYBERSTEFFIE 5 лет назад
THANK YOU SO MUCH!
@skandmishra3739
@skandmishra3739 4 года назад
Thanks for this video :)
@whiskers08spot09
@whiskers08spot09 10 месяцев назад
the slash bringing hasher?
@carlosdebourbondeparme6021
@carlosdebourbondeparme6021 4 года назад
you dont need a new Map per bucket? or is there an benefit?
@kirillpavlovskii8342
@kirillpavlovskii8342 4 года назад
What is the music ? I really love it . And thank you so much ❤️💕
@justadev____7232
@justadev____7232 3 года назад
At 6:07 you said "Lets peek at our hash table", how can I do that in the console?
@stiventson4464
@stiventson4464 4 года назад
The explanation was incredible, but the example she did could have been much better if she had done it from scratch.
@willowsongbird
@willowsongbird 3 года назад
what did you use to run your code? because I tried running it on scrimba and Vscode but I couldn't see the hash table on either.
@akhil_sarikonda
@akhil_sarikonda 5 лет назад
Do you write with the left hand?
@njpromethium
@njpromethium 3 года назад
Cool video! btw stop smacking the keyboard lol
@shrekmeharder6983
@shrekmeharder6983 4 года назад
WOOOAAAAAAH YOUR LIPS ARE SOOOOO SHINY
@ceazykid
@ceazykid 5 лет назад
How come there was a collision of 3 characters ? Is that just random?
@dannytran4667
@dannytran4667 5 лет назад
ceazykid her hash function produced an index of 17 for the 3 characters. This is called a collision.
@devincustodio2258
@devincustodio2258 5 лет назад
See my comment
@randyt700
@randyt700 4 года назад
Her hash function is not appropriately updating the hash value as it's iterating. The function actually just reassigns the hash variable after each iteration instead of cumulatively updating it .
@nicklandreth2527
@nicklandreth2527 4 года назад
I understand at least as well as Spongebob.
@Bayo106
@Bayo106 4 года назад
The music is pretty distracting in this one but thank you
@landrexrebuera9628
@landrexrebuera9628 4 года назад
Didn't knew Nicky Minaj is into programming.
@ahmadshela3912
@ahmadshela3912 4 года назад
كودك بخزي
@user-fp6dt1os1l
@user-fp6dt1os1l 4 года назад
But... you're just using an ES6 Map under the hood... you're not really implementing it yourself
@christophercarmonachriz
@christophercarmonachriz 2 года назад
I thought the same
@seamusquinn8062
@seamusquinn8062 5 лет назад
hashbrown lol
@hacker-7214
@hacker-7214 4 года назад
Youre beautiful and smart :)))
@thebarnowlsmusic
@thebarnowlsmusic 4 года назад
Didn't really learn anything but just copied code :(
@RiA17Verse
@RiA17Verse 2 года назад
Are you a men
@sbrugby1
@sbrugby1 4 года назад
Great explanation but you are too pretty and it's distracting.
@christophercarmonachriz
@christophercarmonachriz 2 года назад
jajaja
Далее
Binary Search Trees | Data Structures in JavaScript
20:25
How to Implement a Hash Table in JavaScript
25:39
Просмотров 104 тыс.
Women’s Celebrations + Men’s 😮‍💨
00:20
Просмотров 3,8 млн
Тренд Котик по очереди
00:10
Просмотров 254 тыс.
Mcdonalds cups and ball trick 🤯🥤 #shorts
00:25
Просмотров 150 тыс.
Understanding and implementing a Hash Table (in C)
24:54
ARRAYLIST VS LINKEDLIST
21:20
Просмотров 64 тыс.
Hash Tables - Beau teaches JavaScript
9:50
Просмотров 93 тыс.
Linked Lists | Data Structures in JavaScript
14:58
Просмотров 31 тыс.
Learn Hash Tables in 13 minutes #️⃣
13:26
Просмотров 359 тыс.
Stacks & Queues | Data Structures in JavaScript
12:49
Hash Tables and Hash Functions
13:56
Просмотров 1,6 млн
JavaScript Visualized - Closures
11:34
Просмотров 42 тыс.
Naming Things in Code
7:25
Просмотров 2,1 млн
Women’s Celebrations + Men’s 😮‍💨
00:20
Просмотров 3,8 млн