Тёмный

Hash Tables - CS50 Shorts 

CS50
Подписаться 2 млн
Просмотров 147 тыс.
50% 1

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

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 129   
@anthonyrosas7838
@anthonyrosas7838 4 года назад
I've started watching these videos in 0.75 speed, and I love drunk Doug explaining complex concepts to me! xD
@Dall1n
@Dall1n 4 года назад
XD 0.5 speed even better!!
@LillieLights
@LillieLights 4 года назад
I watch them at 1.25 speed to save time XD
@jasonbellis9128
@jasonbellis9128 3 года назад
@@Dall1n 0.5 speed is gold! hahah Drunk Doug!
@AJGthree
@AJGthree 3 года назад
I usually watch the lectures at 1.5x. It makes David seem even more energetic than usual lol
@BobbyBundlez
@BobbyBundlez Год назад
LOL
@CODE_and_DESIGN
@CODE_and_DESIGN Год назад
Thank you, Professor Lloyd, for your amazing explanation of the material in CS50x. I have taken many online courses in the past, but this is the only one that has been so comprehensive and well-explained. I never have to waste time searching for additional information because everything I need is covered in the lectures, sections, and shorts.
@jeyko666
@jeyko666 6 лет назад
you are the best! keep it up! can't believe such professional lectures are free. Big up Harvard!
@aprameyaaithal9071
@aprameyaaithal9071 3 года назад
Agreed 100% 👏
@marys.2304
@marys.2304 2 года назад
O0io0o0ii0o0⁰⁸kĺ
@marys.2304
@marys.2304 2 года назад
@@aprameyaaithal9071 gggĺlllllķ
@demaxl732
@demaxl732 Год назад
If these lectures are free just imagine the actual lectures in harvard. Man I wished I was a student there😭😭😭
@kevinrakhitha6019
@kevinrakhitha6019 4 года назад
Loved the Beatles, Simpsons, and Friends references!!
@luckydevil1601
@luckydevil1601 11 месяцев назад
Oh, he linked Phoebe and Joey, so sweeet!😍
@demaxl732
@demaxl732 Год назад
I love harvard university, For some reason almost no one knows how to explaing hash tables in a simple way but this video just clear everything up for me. Thank you Doug!
@pumpkins922
@pumpkins922 Год назад
I love love love Doug's attitude in these videos
@timurmukhtarov1319
@timurmukhtarov1319 4 года назад
This is amazing! The best video explainer of hash tables hands down 🏆
@Ash-em5pm
@Ash-em5pm 5 лет назад
0:33 vsauce music starts playing in the background
@KB-ur4nk
@KB-ur4nk 4 года назад
underrated comment
@alburnto
@alburnto 4 года назад
accurate.
@funtaki3901
@funtaki3901 4 года назад
Best comment i've seen all week!
@Ihavetoreturnsomevideotapes
@Ihavetoreturnsomevideotapes 3 года назад
lol
@thamestrinity
@thamestrinity 2 года назад
This is particularly an exceptional video. If only I could follow Doug into more courses.
@Shiro_Hairo1
@Shiro_Hairo1 3 месяца назад
Thank you, Professor Lloyd!😀
@ElecPrizyy
@ElecPrizyy 3 года назад
best teacher ever thank you Doug Lloyd
@betterhealthtoday644
@betterhealthtoday644 4 года назад
"We've chained "Phoebe" in"
@SumitPilania
@SumitPilania 2 года назад
Thank you for explaining it in such a clear and detailed manner. Cheers :)
@luizashabetnick8059
@luizashabetnick8059 3 дня назад
After implementing linear probing on Doug's hash table example now i understand why its not a good example (different char strings can have the same sum so they are given the same hash code)
@yog7558
@yog7558 3 года назад
Thanks CS50, Sending you guys a big hug❤💚
@mon0theist_tv
@mon0theist_tv Год назад
Why did they switch from "don't write your own hash functions, just find some on the internet" to "you better write your own hash function or else" for pset5 lol
@mollyexten4508
@mollyexten4508 4 года назад
What is the standard way to cite the source of my code? Are there rules for this like there are for writing essays in MLA or APA?
@Jxrrdy
@Jxrrdy 6 лет назад
I love this channel
@FlowersByIrene
@FlowersByIrene Год назад
I like how he says it's a waste of time to make your own hash function but then this weeks problem set tells you to make your own
@s.spambot9095
@s.spambot9095 2 года назад
Dude! What a masterclass of a video!!!!
@miaomar3228
@miaomar3228 Год назад
Curious why the hash function Doug wrote isn’t good? It generates different hash codes for similar data and allows you to increase the number of buckets to the extent of memory Is it because the number of buckets is not related to the number of elements in the hash structure? If so, how would you know the optimal number of buckets?
@ahmetselimerdogan6187
@ahmetselimerdogan6187 Год назад
I think it is bad because it can easily output the same hash code over and over again AB and BA would result in the same hashcode, and also since it is adding up ASCII numbers AAAAA might be equal to ZZZ (the example is symbolic) and then it would result the same hash code as well.
@danielmontilla6629
@danielmontilla6629 Год назад
​@@ahmetselimerdogan6187but if You ask or compare your string to what is actually in the buckets You can diferentiate both, and maybe add some label to like bucket 1.1 and and then if there have the dame ascci value but diferent string You may solv. The things is that You have to iterate and compare all the link list of one bucket.
@saturn52
@saturn52 4 года назад
Doug = Legend
@1mkhlv
@1mkhlv 5 лет назад
Captions aren't not synced with voice. Please fix it
@ArturoJReal
@ArturoJReal 4 года назад
Hi Ilya, thanks for pointing this out! We've updated the subtitles!
@GWeekly2904
@GWeekly2904 Год назад
Thank you so much for the clear explanation
@harshalcharadva4805
@harshalcharadva4805 3 года назад
finally a big confusion was solved. thanks.
@strateeg32
@strateeg32 3 года назад
Rachel and Ross not together in the same list?! How dare you
@daniilmalygin5347
@daniilmalygin5347 Год назад
Thank you so much for this.
@BryceChudomelka
@BryceChudomelka 3 года назад
Awesome. Thanks Doug!
@crististaci9364
@crististaci9364 3 года назад
thank you daddy loyd
@yuchengtsai9888
@yuchengtsai9888 2 года назад
Awesome! Very easy to understand! Thank you!
@mohammedkhateeb4035
@mohammedkhateeb4035 2 года назад
Legend, Thank you
@No-sh6vs
@No-sh6vs 6 лет назад
You forgot Chandler Bing!!!!
@DhyeyThakore
@DhyeyThakore 6 лет назад
Monica too !!
@iSgapetti
@iSgapetti 9 месяцев назад
7:30 "Generally you're probably not going to want to write your own hash functions. It is actually a bit of an art, not a science. And there's a lot that goes into them. The internet, like I said, is full of really good hash functions, and you should use the internet to find hash functions because it's really just kind of an unnecessary waste of time to create your own." Why did you lie to us Doug?
@Axisoft
@Axisoft 6 лет назад
What about in the case that you're trying to add an identical value, e.g. Joey once more? Are duplicates allowed or no?
@AkayAkbyk
@AkayAkbyk 5 лет назад
there would have to be something unique about the values, some piece of accompanying information that makes them unique, for example a sort of unique ID. otherwise there is no point to it, unless you're trying to write a program to find out how many times Joey occurs. but if that was the case, you wouldn't be need to use such a hash table, but would rather use one where the KEY is the name and VALUE is a counter that's incremented with every occurrence of Joey.
@matthewlev1342
@matthewlev1342 6 лет назад
Solid video! Thank you
@zaza2010full
@zaza2010full 6 лет назад
Quicker and faster, like it. *Thumbs up*
@cje8887
@cje8887 3 года назад
n o w w e h a s h h o m e r
@bleszieernestinesimbulan3986
@bleszieernestinesimbulan3986 4 года назад
I hope they had the source code for this lesson
@codingwithelhacen990
@codingwithelhacen990 5 лет назад
great explanation
@Olden2610
@Olden2610 2 года назад
Not really sure that is lookup speed is O(1) How should we distinguish two different objects with the same hash without additional logic?
@shrutipulstya9
@shrutipulstya9 4 года назад
FINALLY A GOOD VIDEO .
@porobignardi8369
@porobignardi8369 4 месяца назад
Awesome
@db18022
@db18022 6 лет назад
oh what a relief bro, thanks!
@syedmazharalishah8158
@syedmazharalishah8158 6 лет назад
Thanks for teaching.... You are good.. I give you the credit for the work you did ... Plegiarism you said remember!
@GaganDeepSinghMusic
@GaganDeepSinghMusic 3 года назад
Well explained!
@lintz_lin
@lintz_lin 2 месяца назад
6:23 "you see what's going on here?" er... sorry, no
@Teach-CS
@Teach-CS 4 года назад
15:05 Shouldn't that be node hashtable[10], since it arrays are already pointers??
@jordanemmett23
@jordanemmett23 4 года назад
Nah because the data type is node*
@itspurelypassionate
@itspurelypassionate 4 года назад
Aha! Friends 😁 Chandler and Monica are missing😅
@GOODBOY-vt1cf
@GOODBOY-vt1cf 4 года назад
thank you!
@alaakliche9443
@alaakliche9443 2 года назад
is shazem using hashing when searching for music ??
@simonkalu
@simonkalu 6 лет назад
interesting topic. Thanks, teacher. Advanced topic. Could you suggest some real-life applications?
@gui1542
@gui1542 6 лет назад
Hash tables are used everywhere. There are entire database system designed around hash tables (Redis). The language python is entirely built around dictionaries, which are essentially hash tables.
@danielflores407
@danielflores407 6 лет назад
In Javascript for example all objects are hash tables, you can find Hash Tables under the name of Associative Array
@abollden
@abollden 6 лет назад
A real life example could be if you are looking for duplicates in an array. You could loop through each element of the array and create a key value for that element. If the key already exists, then you know you've found a duplicate. The benefit of hash tables is as follows: if you use an ordinary hash object you would have to search each key of the hash object to see if the key already exists, potentially searching through the entire hash object. The benefit of the hash table is the hash function will give you a specific "address" for the key so you can check to see if the key for that specific element exists in one look, instead of having to look at each key in the hash object. In terms of computational complexity, to search a hash object it takes O(n) time but for hash tables it takes O(1).
@srijanpaul
@srijanpaul 4 года назад
Many popular language interpreters (Python for example) use them to store your variable names and their respective values. That's how your interprerer knows which variables refers to what. They're also used in JS. Every single JavaScript object is actually a hashtable under the hood.
@CeaserMadrazo
@CeaserMadrazo Год назад
I feel like such an idiot... No matter how many times I try to understand the Week 5 content, I just can't follow it...
@serdashehu
@serdashehu 4 года назад
the beatles ha
@mr.mirror1213
@mr.mirror1213 3 года назад
Hey but what about cache misses in linked list ?? I thought of using a dynamic array
@colonizatorgg5960
@colonizatorgg5960 4 года назад
But if hashtable don't have linked list for handle collisions, is hashtable still it?
@gabrielpereiramendes3463
@gabrielpereiramendes3463 5 лет назад
Very Good!
@BobbyBundlez
@BobbyBundlez Год назад
unreal.
@adilismail3593
@adilismail3593 5 лет назад
Wat r buckets in hash tables?
@fabianandrespinedasalazar297
@fabianandrespinedasalazar297 4 года назад
Captions are not sync :/
@ArturoJReal
@ArturoJReal 4 года назад
Hi Fabian, thanks for pointing this out! We've now updated the subtitles!
@fabianandrespinedasalazar297
@fabianandrespinedasalazar297 4 года назад
@@ArturoJReal perfect!!
@MenottiRicardo
@MenottiRicardo 4 года назад
where can i find hash functions already created?
@srijanpaul
@srijanpaul 4 года назад
Google should yield some results. They aren't uncommon at all.
@baatar
@baatar 5 лет назад
Why are we getting collisions? Shouldn't a good hash function barely have any?
@MRender32
@MRender32 5 лет назад
It's not something that can be completely avoided, so there needs to be protocol.
@AwsmLx
@AwsmLx 5 лет назад
depends on what you are trying to achieve
@sengelhard2982
@sengelhard2982 5 лет назад
Collisions are always possible. The hash value is inherently smaller than the value being hashed, so considering all possibilities, there have to be some values that result in the same hash.
@kattodoggo3868
@kattodoggo3868 3 года назад
Geez this speller is killing me
@GaneshPatil-fs6cn
@GaneshPatil-fs6cn 3 года назад
1000 Likes
@JigarPatel28
@JigarPatel28 6 лет назад
I don't think you'd be allowed to look up hash functions online during interviews sir
@indrajeet9251
@indrajeet9251 6 лет назад
Use this in industry.
@rautermann
@rautermann 4 года назад
I just love the pride with which they say "THIS is CS50" at the end of each video. That's really contagious, makes me proud to be a part of it, too!
@davidjmalan
@davidjmalan 4 года назад
Welcome aboard!
@rautermann
@rautermann 4 года назад
@@davidjmalan Thank you! I just learned about the genesis of this catchphrase in your freecodecamp interview, haha... For everybody interested, listen to it here: freecodecamp.libsyn.com/ep-71-harvard-cs50s-david-malan-and-colton-ogden-on-computer-science (The part about "THIS is CS50" starts at 01:59:50)
@jadia
@jadia 6 лет назад
Great explanation and that FRIENDS reference though. xD
@mweb7344
@mweb7344 4 года назад
lol
@facundoalvarado9
@facundoalvarado9 4 года назад
Saved my academic life, thanks!
@GenZ_01_
@GenZ_01_ 2 месяца назад
As David likes to say . The complexity escalated quickly . Thanks for an awesome explanation!!!
@UnknownUnknown-tx1jc
@UnknownUnknown-tx1jc 6 лет назад
I was thinking about Doug's hash function. He said his hash function is not the best for some reason he was going to get into right now. Is anyone curious about the reasons. looking at the function it add the ascii representation of all the letter in the in the so call string. it then takes the sum of the ascii value of each letter and devide it by size of the array. who could tell me what could go wrong ?? Well suppose when hash jhon and we had a return hash code of 4, suppose we now hash jhon in reverse (nohj) or any sequence of the same characters arrange differently to form another name of the same length , we are going to get the same hash code for these names in other word some collisions. so I guess that's bad but what are the chances right ?? OH by the way thanks for the great lecture Doug. I finally got hash tables
@AkayAkbyk
@AkayAkbyk 5 лет назад
to me it seems like you'd want to use another way of dealing with collisions not because his way would be technically wrong but because as the array grows, you'll eventually run into inefficiencies that negates any performance you gained by using hash tables. for example, what if your array needs to get larger? you'd have to rehash all the values because your "mod" changes. and unless you implement some kind of mechanism to deal with collisions, the max number of elements you can store in your array will be limited to the size of your array (plus one if your default base index is 0.)
@edmondes489
@edmondes489 6 лет назад
Excellent explanation: you made it clear for me! Thank you.
@chiragsharma3688
@chiragsharma3688 4 года назад
Hey Dug! you forgot Monica and Chandler lol
@brianlobato1481
@brianlobato1481 4 года назад
I'm having some trouble trying to understand how to use the hash tables I can find online. Can someone help me with that? Did any of you had problems with this pset5 and have some good hints for someone who is lost?
@treddshort
@treddshort 6 лет назад
Hash the citizens of Springfield.
@superdude512
@superdude512 3 года назад
Milhash
@BasicFTB
@BasicFTB 3 года назад
Super Dude underrated comment
@溜溜梅-l4z
@溜溜梅-l4z 10 месяцев назад
Thank you very much!!!
@uttkarshsachan4063
@uttkarshsachan4063 3 года назад
3:00 for future reference!
@veroniquev7181
@veroniquev7181 2 года назад
John, Paul, Ringo... and that's why I love CS50
@umarmurtala5572
@umarmurtala5572 Год назад
Thank you so much for the illustrative explanation. You just saved my day.
@edwinma6236
@edwinma6236 3 года назад
why is x = 4,(and y =6)? what is stopping x from being 0 or 7?
@abusayeed4551
@abusayeed4551 2 года назад
you really described in a fantastic way....
@buitrungthien
@buitrungthien 4 года назад
Can't thank you enough!
@yicai7
@yicai7 Год назад
Awesome
@anagabriele7340
@anagabriele7340 4 года назад
thank you!!!
@nezzzumi1
@nezzzumi1 4 года назад
(y)
@SugerNoor1996
@SugerNoor1996 4 года назад
you r great
@abollden
@abollden 6 лет назад
Can somebody recommend a great hash function for javascript?
@DrewCantSkate
@DrewCantSkate 4 года назад
Doug you are a legend, thank you.
@nowinandroid
@nowinandroid 6 лет назад
or we can just use HashTable classes and leverage OOP... without even worrying about it :D
Далее
Tries - CS50 Shorts
16:24
Просмотров 73 тыс.
Understanding and implementing a Hash Table (in C)
24:54
Офицер, я всё объясню
01:00
Просмотров 3,2 млн
Главное рыба есть, а воды нет..
00:54
Kenji's Sushi Shop Showdown - Brawl Stars Animation
01:55
SQL - CS50 Shorts
23:19
Просмотров 85 тыс.
CS50 Cybersecurity - Lecture 1 - Securing Data
1:55:22
Просмотров 128 тыс.
Hash Tables and Hash Functions
13:56
Просмотров 1,6 млн
Hash Tables - Data Structures and Algorithms
20:16
Просмотров 38 тыс.
Python - CS50 Shorts
39:01
Просмотров 134 тыс.
CS50x 2024 - Lecture 3 - Algorithms
2:02:12
Просмотров 296 тыс.
4. Hashing
52:55
Просмотров 332 тыс.
Hash Table in C
2:11:31
Просмотров 65 тыс.