Lecture 8: Hashing with Chaining

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ส.ค. 2024
  • MIT 6.006 Introduction to Algorithms, Fall 2011
    View the complete course: ocw.mit.edu/6-006F11
    Instructor: Erik Demaine
    License: Creative Commons BY-NC-SA
    More information at ocw.mit.edu/terms
    More courses at ocw.mit.edu

ความคิดเห็น • 260

  • @sergeykholkhunov1888
    @sergeykholkhunov1888 3 ปีที่แล้ว +70

    00:55 dictionary
    05:10 dict in Python
    06:30 motivation
    13:40 simple approach
    17:50 prehash
    24:00 hashing
    30:15 chaining
    42:05 hash functions

  • @bobbob3630
    @bobbob3630 6 ปีที่แล้ว +389

    @ everyone saying this guy is amazing, and wishing their teacher was like this, this guys is insanely good, he started university when he was 12, got his bachelors degree when he was 14, and completed his PhD thesis when he was 20. He's the youngest every teacher at MIT

    • @w1d3r75
      @w1d3r75 4 ปีที่แล้ว +10

      The real goat 🐐

    • @tross3868
      @tross3868 4 ปีที่แล้ว +4

      Example= MIA(2*2)------>4,
      M-77
      I-105
      A-97, Equation= sum of axes divided by array boxes and then 77+105+97 / divided by 11, which is the number of array boxes. 279/11=8 , I know afterwards I would find the next index number for the new key/name given , its just that I wrote this down about a year ago , but the part about how I found the axes 77,105,& 97 is missing , so can u renew my memory on how I go about finding the axes again?

    • @dragon_warrior_
      @dragon_warrior_ 4 ปีที่แล้ว +4

      @@tross3868 okaaaayyyyy

    • @Gustavo_Rojas
      @Gustavo_Rojas 4 ปีที่แล้ว +5

      and he looks like he's 10! =)

    • @justbedouin6437
      @justbedouin6437 3 ปีที่แล้ว +2

      what his name ??

  • @olivercopleston
    @olivercopleston 7 ปีที่แล้ว +176

    The core strength this man displays with that chalk-handing is god-like.

    • @Xaminn
      @Xaminn 5 ปีที่แล้ว +14

      Especially at 1.5 speed lol

    • @wilhelm.reeves
      @wilhelm.reeves 5 ปีที่แล้ว

      @@Xaminn 😜

  • @starogre
    @starogre ปีที่แล้ว +10

    This guy is a genius. He founded his first software company when he was 8 with his dad. At 10 he graduated high school (not validictorian) and went on to university. At 13 he graduated university and sold his company for 1.2 million dollars. He went on to win a Politzer prize and patent for a computerized fabrics machine. MIT asked him to start teaching at the age of 16 and here we are.

  • @User-cv4ee
    @User-cv4ee 4 ปีที่แล้ว +11

    If anyone is curious, hash('\0B') does NOT equal hash('\0\0C') (or '\0\0c') anymore in python (ipython 7.13)

  • @gladysmayettepatricio5726
    @gladysmayettepatricio5726 3 ปีที่แล้ว +19

    Awesome lecture! I can't imagine the number of books he have read and the skills he have mastered to be this good. So much respect sir. You are worth emulating!

  • @georgelin8019
    @georgelin8019 3 ปีที่แล้ว +18

    I'm jealous of those MIT students, so lucky to have such a great prof.

    • @juliocardenas4485
      @juliocardenas4485 3 ปีที่แล้ว +2

      Yet, we are all here 😎. Good for you for learning on your own

  • @roflbot101
    @roflbot101 6 ปีที่แล้ว +6

    Thank you, Mr. Demaine, for rocking the chalk like you rock the ponytail: with gusto and aplomb.

  • @companymen42
    @companymen42 7 ปีที่แล้ว +69

    My Algorithms teacher is shit. She reads off her power point VERBATIM!! I want my money back because this guy has taught me more than she ever could.

  • @reassume4826
    @reassume4826 6 ปีที่แล้ว +3

    I can read here many people are complaining that if they had teacher like this lecturer,they would be happy.
    But the matter of fact is they all have him. Eric is teaching that's what teacher does , it's your job to make as much use of it and donate for such causes once you succeed in life.

  • @7th_CAV_Trooper
    @7th_CAV_Trooper ปีที่แล้ว +7

    So many cool things going on beyond the lecture content. First, the movable boards. That is so cool. Never saw anything like this before in my 53 years. Second, Erik's writing style on the board is very clear. Headings underlined, numbers circled, etc. It's all very on-purpose and makes me wonder if that comes from formal training or if Erik devised it on-the-fly. The content is great too. He explains the concepts with the ease of someone with deep understanding. Loving this series.

  • @SneakyMrSnake
    @SneakyMrSnake 9 ปีที่แล้ว +227

    This teacher is awesome

    • @jackfever405
      @jackfever405 8 ปีที่แล้ว +3

      +Snake agree

    • @SumoCumLoudly
      @SumoCumLoudly 6 ปีที่แล้ว +3

      He had bachelors degree at age 14 and phd at 20

    • @csl1384
      @csl1384 4 ปีที่แล้ว

      @NameHe was 30 or 31, born in 1981. But who cares? The lecture is awesome all the same.

    • @tross3868
      @tross3868 4 ปีที่แล้ว

      Example= MIA(2*2)------>4,
      M-77
      I-105
      A-97, Equation= sum of axes divided by array boxes and then 77+105+97 / divided by 11, which is the number of array boxes. 279/11=8 , I know afterwards I would find the next index number for the new key/name given , its just that I wrote this down about a year ago , but the part about how I found the axes 77,105,& 97 is missing , so can u renew my memory on how I go about finding the axes again?

  • @TheNikatlas
    @TheNikatlas 9 ปีที่แล้ว +1

    @siddarth kamaria There is a Collection of hash functions you can use. 'a' and 'b' are random chosen in the beginning. Since then you must use the same hash function.

  • @SirHirnschaden
    @SirHirnschaden 8 ปีที่แล้ว +31

    i would love to have a prof. like this :D i sleept in so many time in our class about hashing x.x but he get me the motivation!
    greets from germany!

  • @NikitaYVolkov
    @NikitaYVolkov 10 ปีที่แล้ว +193

    God I wish I had teachers like that.

    • @weizhixie9678
      @weizhixie9678 5 ปีที่แล้ว +20

      Now you have it. How is your algorithms?

    • @wilhelm.reeves
      @wilhelm.reeves 5 ปีที่แล้ว +2

      @@weizhixie9678 XD

    • @Marko-up6js
      @Marko-up6js 4 ปีที่แล้ว

      my professor just gave us about 6 simple very dry PP slides, gave us starter code with data structure and gave us a pop quiz. I wish this guys was my professor.

  • @SrbijaaBree
    @SrbijaaBree 7 ปีที่แล้ว +69

    This guy is even more awesome at 1.5 speed

    • @icosmini
      @icosmini 5 ปีที่แล้ว +6

      Also at 2.0

    • @horotat
      @horotat 5 ปีที่แล้ว

      @@icosmini Agree

    • @patmaloyan620
      @patmaloyan620 4 ปีที่แล้ว

      hahahah. I keep forgetting this and these comments keep saving me. 1000% focus increase.

    • @bezelyesevenordek
      @bezelyesevenordek 3 ปีที่แล้ว +1

      @@patmaloyan620 yeah yeah. it's awesome to listen the courses at 1.5 or 2.0 speeds and it's increasing the focus. absolutely great. and we're finishing it in less time too. tons of time saved, thanks for the youtube videoplayer.

  • @GaryCh
    @GaryCh 9 ปีที่แล้ว +7

    MIT is so freaking lucky. At UPenn and Temple, I had to write notes like a madman because no lectures were recorded. I wasted sooo much time writing notes and trying to write fast enough that the lecture was pretty much pointless, and resulted in me basically reviewing notes and asking questions at a later time.

    • @GaryCh
      @GaryCh 9 ปีที่แล้ว

      An aside I notice when I was like WTF why is no one writing notes

    • @MrGencyExit64
      @MrGencyExit64 9 ปีที่แล้ว +1

      Gary C I never took notes ever and graduated top of my class; it's best just to pay attention to the lecture in class and then use a textbook for anything concrete.

  • @PrateekGuptacs
    @PrateekGuptacs 8 ปีที่แล้ว +2

    That was an awesome lecture. Thanks MIT :)

  • @yalopov
    @yalopov 7 ปีที่แล้ว +5

    damn this videos are so damn cool, i wish i had an actually good teacher like him

  • @austinahne3754
    @austinahne3754 7 ปีที่แล้ว +24

    He starts talking about at chaining at 30:15.

    • @chinglinwen
      @chinglinwen 4 ปีที่แล้ว

      I thought he just skipped the solution to the problem 1 of map to non-negative integer. which relate to hash functions.

  • @user-pf3gu6bj1p
    @user-pf3gu6bj1p 7 ปีที่แล้ว +2

    I love these videos!

  • @pixelhunter0
    @pixelhunter0 10 ปีที่แล้ว +3

    hash("\b0")=hash("\0\0C")=64 means that two different keys map to the same thing, 64. ideally you want if hash(x)=hash(y) then x=y that means the keys are the same. but sometimes we can have a collision where x!=y.

  • @andres3398
    @andres3398 7 ปีที่แล้ว +3

    Great teacher !

  • @luisdanielmesa
    @luisdanielmesa 9 ปีที่แล้ว +27

    40:30 how could they not laugh at that???? It's gold.

    • @and1fer
      @and1fer 8 ปีที่แล้ว

      +Luis Daniel Mesa Velasquez can u explain the star wars reference?

    • @vasiliskourepinis4329
      @vasiliskourepinis4329 8 ปีที่แล้ว +1

      +and1fer Star Wars, A New Hope, Ben kenobi to the stormtrooper: "These aren't the Droids your looking for"

    • @spidLL
      @spidLL 8 ปีที่แล้ว +1

      +Luis Daniel Mesa Velasquez probably because they never watched it :(

    • @luisdanielmesa
      @luisdanielmesa 8 ปีที่แล้ว

      spider :´(

  • @Topbitcoinexchanges
    @Topbitcoinexchanges 9 ปีที่แล้ว

    Excellent lecturer. Bravo sir

  • @englishconversation590
    @englishconversation590 5 ปีที่แล้ว

    Thanks teachers, lession is awesome.

  • @bosshaug5672
    @bosshaug5672 2 ปีที่แล้ว +3

    This guy is awesome, even 9 years later, still better than my professors. i just wish I had a CS prof that could speak english :/

  • @user-wt7ut4xj5r
    @user-wt7ut4xj5r 3 ปีที่แล้ว

    Thank you teacher for just being there

  • @RagHelen
    @RagHelen 6 ปีที่แล้ว +1

    He's right! In Python, the id of an object is equal to the hash of the id.
    d = { 'a': 1, 'b': 2, 'c': 3 }
    for key,value in d.items():
    print(key)
    print(id(key))
    print(hash(id(key)))
    Output:
    a
    5045920
    5045920
    b
    5044240
    5044240
    c
    4964624
    4964624

  • @deb5976
    @deb5976 2 ปีที่แล้ว

    amazing class. Thanks for making this public

  • @Zerpentile93
    @Zerpentile93 10 ปีที่แล้ว +1

    Thanks for uploading this.

  • @websoftwaredeveloperijtiha3093
    @websoftwaredeveloperijtiha3093 ปีที่แล้ว +1

    It's so cool that these top schools release courses like this one online free of charge. I may not get a chance to go to MIT

  • @Hideot0
    @Hideot0 10 ปีที่แล้ว +47

    Actual hashing is only addressed at 24:00

  • @coderopes2983
    @coderopes2983 5 ปีที่แล้ว

    These courses are awesome N helpfull

  • @guilhermeborges4097
    @guilhermeborges4097 6 ปีที่แล้ว +1

    Dopest class, much better than my dear teachers, or almost dear... whetheaver, thanks!!!!

  • @adijo123
    @adijo123 11 ปีที่แล้ว

    Wonderful lecture.

  • @abhishekraj7713
    @abhishekraj7713 2 ปีที่แล้ว

    Literally a good explanation I got❤

  • @MegaVuhung
    @MegaVuhung 11 ปีที่แล้ว

    awesome instructor

  • @justbedouin6437
    @justbedouin6437 3 ปีที่แล้ว

    I like the way when he explains hash meaning hhh.. Thank you

  • @willmorgan8830
    @willmorgan8830 4 ปีที่แล้ว

    Excellent explanation. A++

  • @svnthsz3r
    @svnthsz3r 9 ปีที่แล้ว +1

    Big Thanks from Austria!! :D

  • @ronnypolle4350
    @ronnypolle4350 6 ปีที่แล้ว

    i love MIT! i love EriK Demaine!

  • @seansmith1685
    @seansmith1685 7 ปีที่แล้ว

    Great lecture

  • @wolfinthesuit
    @wolfinthesuit 2 ปีที่แล้ว +1

    If teaching in 2022 was like this I would really be mf Genius in Data structure and IT, unfortunately they only stream videos and you MUST UNDERSTAND IT ALONE

  • @raseshgupta6276
    @raseshgupta6276 9 ปีที่แล้ว +1

    You are awesome! Big Thanks

  • @mrwess1927
    @mrwess1927 5 ปีที่แล้ว

    Thankful for this

  • @seaoftears1
    @seaoftears1 4 ปีที่แล้ว

    excellent course

  • @Stealth1337
    @Stealth1337 2 ปีที่แล้ว +1

    great stuff !

  • @abdallaelmedani8933
    @abdallaelmedani8933 6 ปีที่แล้ว +12

    You are an amazing teacher, Erick :-)
    Btw "Hasheesh" in Arabic means "marijuana"!!

  • @lenaggar
    @lenaggar 6 ปีที่แล้ว

    great teaching

  • @tross3868
    @tross3868 4 ปีที่แล้ว

    Example= MIA(2*2)------>4,
    M-77
    I-105
    A-97, Equation= sum of axes divided by array boxes and then 77+105+97 / divided by 11, which is the number of array boxes. 279/11=8 , I know afterwards I would find the next index number for the new key/name given , its just that I wrote this down about a year ago , but the part about how I found the axes 77,105,& 97 is missing , so can u renew my memory on how I go about finding the axes again?

  • @shivanshuraj7175
    @shivanshuraj7175 6 ปีที่แล้ว

    a Very much satisfying place to learn cs

  • @nimahefazi9887
    @nimahefazi9887 11 ปีที่แล้ว

    Very helpful. Thanks.

  • @SD-gp3xx
    @SD-gp3xx 11 หลายเดือนก่อน

    @MIT Opencourseware While explaining simple uniform hashing, Erik suggested that independence is necessary but is independence really necessary?
    The expected length of a chain comes out the same whether you assume independence or not.
    My solution without assuming independence:
    let R1 be indicator random variable for the event that a random key falls into the 1st bucket. R2 be the independent random variable for the event that a random key falls into the 2nd bucket and so on. Initially assume all slots or buckets are empty. A chain length becomes length one when a random key falls into one of the slots and remains the same when it falls into any other bucket.
    So, l1 be the length of chain in the first slot; l2 be the length of chain in the second slot and so on.
    So, total length of chain would be l= l1+l2+l3+...+lm.
    So, expected length of chain E(l)= E(l1+l2+l3+...+lm)= E(l1)+ E(l2)+ E(l3)+...+E(m).... (by linearity of expectation which does not need independence).
    E(l1)= 1.1/m+ 0.(1-1/m)= 1/m = E(l2)= E(l3)=...=E(lm)
    So, E(l) would be n/m. I did not assume independence.
    Where did I go wrong? Someone please explain.

  • @electricgirltakesonworld2384
    @electricgirltakesonworld2384 5 ปีที่แล้ว

    can someone explain key space? why is memory allocated to key space a problem in direct access tables?

  • @prateeksinghal630
    @prateeksinghal630 4 ปีที่แล้ว +2

    I didn't even feel when those 50+ minutes passed!!

  • @moabsmithbey9583
    @moabsmithbey9583 6 ปีที่แล้ว +2

    I love how he explain the algorithem problems also he look young.

    • @mitocw
      @mitocw  6 ปีที่แล้ว +10

      Thanks for your comments! A little trivia: Erik Demaine became MIT's youngest professor in Fall 2001: news.mit.edu/2003/demaine-0226.

  • @vasiliskourepinis4329
    @vasiliskourepinis4329 8 ปีที่แล้ว +7

    The lecture was awesome, but the starwars reference was even better!

  • @Speed4Runs
    @Speed4Runs 6 ปีที่แล้ว +1

    now that's the typical nerd look you would get after becoming an algorithms teacher. love it.

  • @siddharthkamaria
    @siddharthkamaria 9 ปีที่แล้ว

    How can 'a' and 'b' be random? If we call the hash function another time it might generate another values for 'a' and 'b'. I'm unclear what is he referring to by describing 'a' and 'b' as random...Any help would be appreciated.

  • @srinikethvelivela9877
    @srinikethvelivela9877 3 ปีที่แล้ว +1

    15:46 Why something is hard to associate with integers

  • @bedekelly5474
    @bedekelly5474 9 ปีที่แล้ว +5

    If a and b are random, does that make the hash function non-deterministic? Do we have to cache the calculated hashes in order to look items up in a hash table after they've been inserted?

    • @nguyennguyenphuc5217
      @nguyennguyenphuc5217 7 ปีที่แล้ว +2

      maybe a and b are chosen from very first and stored as constants

    • @anteconfig5391
      @anteconfig5391 5 ปีที่แล้ว

      @Bede Kelly I was wondering the same thing. I think maybe yes.

  • @hrishikeshkulkarni2856
    @hrishikeshkulkarni2856 6 ปีที่แล้ว +4

    Wow MIT has masterpiece teachers!

  • @farshidnooshi6815
    @farshidnooshi6815 6 ปีที่แล้ว

    very very awesome ...

  • @GeekMonsterWindel
    @GeekMonsterWindel 11 ปีที่แล้ว +9

    Pillows?! Wow that's peculiar. I almost thought that was some sort of secret invitation to a underground brainiac party held by him (he has that cult leader quality).

  • @OMGitsjustperfect
    @OMGitsjustperfect 7 ปีที่แล้ว

    I understand how to put stuff in the hashtable, what I don't understand is how to look it back up. If your key is random, how do you know which key to look up?

  • @amithreat
    @amithreat 8 ปีที่แล้ว

    thanks MIT

  • @cammiltaank
    @cammiltaank 7 ปีที่แล้ว +2

    At 33:15 Erik draws a linked list to store multiple items where their key collides. How does one retrieve the correct item on a lookup? The keys themselves seem to be absent from the linked list, so how do you know which item to return?

    • @dergons
      @dergons 7 ปีที่แล้ว +2

      I think the assumption is that the item is a tuple with the key and corresponding value. As in the Python implementation explained earlier in the video.

    • @asshole9191
      @asshole9191 7 ปีที่แล้ว

      The key is immutable for each object. Otherwise you couldn't reconstruct it later on. So either you calculate the key for each object in the list anew or you save tuples.

  • @taniarahman9028
    @taniarahman9028 10 ปีที่แล้ว

    Awesome!

  • @a.a7907
    @a.a7907 7 ปีที่แล้ว

    Thank you for the video. I have question. Why don't we instead of using hash table and liked list together, use two hash tables and link them with a unique queue.

    • @eagerassaultixopi4558
      @eagerassaultixopi4558 4 ปีที่แล้ว

      Its called double hashing and it will leave us with more unallocated space.

  • @harryzhang5984
    @harryzhang5984 3 ปีที่แล้ว +1

    Who else is Still watching this video in 2021??? Great lecture!

  • @sidnarayan438
    @sidnarayan438 4 ปีที่แล้ว +1

    I died laughing at his references, Erik Demaine is such a cool geek

  • @wowzande
    @wowzande 4 ปีที่แล้ว

    halfway through this lecture, just wondering , can i use this information if im coding in c++ or will some of the stuff be different. Im currently learning hashing for my advanced algorithms class, someone let me know so i don't waste my time or go off in a tangent.

    • @rallokkcaz
      @rallokkcaz 4 ปีที่แล้ว

      No tangent, you're probably kind of screwed. And yes it will be different by vast margins, C++ has std::hash_map and std::unordered_map. However if you need to implement a hash map, it's not the same.

  • @damienrochford2230
    @damienrochford2230 7 ปีที่แล้ว +7

    What is the difference between a prehash and a hash function? I didn't feel totally clear on that point after this lecture.

    • @Orww
      @Orww 7 ปีที่แล้ว +1

      It's also known as hashing (prehash) and compression (hash), maybe that helps

    • @augustopaiva9154
      @augustopaiva9154 7 ปีที่แล้ว

      if the key are not an intergers, you use the prehash to make then in a intergers and then use the hash fuction. I think.

    • @Gukslaven
      @Gukslaven 7 ปีที่แล้ว

      Yeah I've never heard of a prehash and hash the way he describes it. I know it as: the hash function turns an object into an integer. And the compression function gives you some integer within the bounds of the underlying array.
      A google search doesn't give that many results for pre-hash or prehash so... my guess is the are less popular terms (?)

    • @elle1718
      @elle1718 7 ปีที่แล้ว +11

      From my understanding, prehash merely turns your non-int keys into integers but does not address the problem of space, so you hash the resultant integer using a more complex hash function which should theoretically convert the integer into another integer within a specific set of integers with m as the upper bound

    • @rdwells
      @rdwells 7 ปีที่แล้ว +1

      The "prehash" is a function that converts the state of the key object to an integer; the "hash" function converts it to a hash table index.
      This is a logical division of labor; the key type "knows" how to convert the object to an integer, and the hash table "knows" how to convert that integer to a hash table index. But neither of them has to know anything about the other.
      What he's calling the prehash is done in Java, for example, by overriding the Object.hashCode() method; in C++, it is generally done by define a hash class and implementing operator().
      The hash function then generally uses either the division method or the multiplication method, as described in the video. I personally prefer the multiplication method since it works with hash table sizes that are powers of 2, and that allows you to use the table resizing discussed in the next lecture in this series.

  • @Cruz0e
    @Cruz0e 10 ปีที่แล้ว

    3:05 what's the point to override a key? nothing changes
    I guess he meant to override the item not the key

  • @kzterminator
    @kzterminator 7 ปีที่แล้ว +1

    ak+b mod p and p is a huge number? ain't that just equal to ak+b?

  • @juliawenkmann8510
    @juliawenkmann8510 4 ปีที่แล้ว +1

    What is he throwing at 17:07 ?

  • @Jose-pj9sk
    @Jose-pj9sk 11 ปีที่แล้ว

    hey what about coalesced chaining >.

  • @chaitanaya677
    @chaitanaya677 7 ปีที่แล้ว

    so, is the key converted to an int before performing the hash functions

    • @rdwells
      @rdwells 7 ปีที่แล้ว

      Yes. See my reply above to Damien Rochford.

  • @black-sci
    @black-sci 5 หลายเดือนก่อน

    Can someone tell what's difference between hash and prehash.

  • @kishorebabu8470
    @kishorebabu8470 10 ปีที่แล้ว +4

    They are actually seat cushions.... Srini explains that the seats in the hall are uncomfortable to sit on for long durations. So a cushion is a perk one earns for answering questions.
    I wouldn't be surprised if there a cult angle to the scenario though.

  • @idontevenlikehavingagoogle8077
    @idontevenlikehavingagoogle8077 10 ปีที่แล้ว +21

    i dont even know why i go to class anymore..cept for midterms

    • @gherbihicham8506
      @gherbihicham8506 9 ปีที่แล้ว +8

      For that useless piece of paper that says doing some shitty handwork by some professor is a better way to be recognized on the job market than learning by your self .

    • @iFloops
      @iFloops 9 ปีที่แล้ว +2

      Gherbi Hicham You're very misguided.

    • @gherbihicham8506
      @gherbihicham8506 9 ปีที่แล้ว

      stampsr92 Elaborate please ...

    • @ionezgb
      @ionezgb 8 ปีที่แล้ว +3

      +Gherbi Hicham Employer doesn't have time to test every job applicant so he/she wants a proof of knowledge issued by institutions which he/she trusts same way you want to use medicine approved by official institution for testing medicine.

    • @gherbihicham8506
      @gherbihicham8506 8 ปีที่แล้ว +1

      ionezgb I didn't say every job , sure i won't go to someone without a medicine degree if i felt pain , some jobs just need to be certified by an institution , some can only be proven by institution , again how on earth are you going to prove that you can prescribe drugs without a university degree ? that's not my point , my point is that a lot of jobs don't need a university degree at all and its good respectable well payed jobs as well, being a programmer for example can have multiple other proofs of knowledge other than a University degree , good projects on Github , a good Stackoverflow reputation count , even down right list of the projects you've built and several other things can land you a job as a developer in a lot of places, infact some jobs will even require things like your programming profile.
      This misconception that you need college in order to work a proper or a well paying job is just getting ridiculous, a lot of people don't have the time nor the financial resources to engage in a university program, and a lot of people who enrole in college for a useless liberal arts degree only find themselves several years later with no job and a massive loan , University shouldn't be for every one , and not everything needs a degree .
      This is coming from someone who spent 5 years at college for a masters in Computer Science .

  • @tanvishinde805
    @tanvishinde805 3 ปีที่แล้ว +3

    Does anyone feel why the lecture is bounded by time, I just he feel he explains whatever knowledge he has in how much ever time he needs for it. Awesome lecture @ErikDemaine

  • @VideoHub81
    @VideoHub81 6 ปีที่แล้ว +19

    24:08 hashish vs hashing

    • @tross3868
      @tross3868 4 ปีที่แล้ว

      Example= MIA(2*2)------>4,
      M-77
      I-105
      A-97, Equation= sum of axes divided by array boxes and then 77+105+97 / divided by 11, which is the number of array boxes. 279/11=8 , I know afterwards I would find the next index number for the new key/name given , its just that I wrote this down about a year ago , but the part about how I found the axes 77,105,& 97 is missing , so can u renew my memory on how I go about finding the axes again?

    • @VideoHub81
      @VideoHub81 4 ปีที่แล้ว

      @@tross3868 how's this related to my comment?

    • @it41tanmayaron26
      @it41tanmayaron26 3 ปีที่แล้ว +1

      @@tross3868 yeah, it can be done. I did something similar to this some time ago

  • @VuHoang-vh6nj
    @VuHoang-vh6nj ปีที่แล้ว

    professor is really an heavy job

  • @landanparker911
    @landanparker911 9 ปีที่แล้ว

    the issue with collision, if the developers had just taken the string of bytes, appended itself, for example /0B and /0/0C, turn that into /0B + B0/, and /0/0CC0/0/ so that you have palindromes, the collision should occur less if at all, instead of using the raw string of hash.

  • @paulmarkert5907
    @paulmarkert5907 3 ปีที่แล้ว

    Ok, I'm inspired. Time to go code.

  • @chukwudioranu2309
    @chukwudioranu2309 3 ปีที่แล้ว

    *chef's kiss*

  • @thedadar
    @thedadar 5 ปีที่แล้ว

    why you not use a projector?

  • @gavinchou3022
    @gavinchou3022 5 ปีที่แล้ว +1

    42:14 hash function fundamentals.

  • @chinglinwen
    @chinglinwen 4 ปีที่แล้ว

    Why load factors means constant time? can someone explain?

    • @chinglinwen
      @chinglinwen 4 ปีที่แล้ว

      load factor=O(1), if m=O(n), is this mean, if m is big enough to cover n, it's a constant time?

  • @metaldetectingmichigan6050
    @metaldetectingmichigan6050 3 ปีที่แล้ว

    Did anyone else notice the blunt behind the guy’s ear at 1:48 😂😂😂

  • @twittertalks3934
    @twittertalks3934 3 ปีที่แล้ว

    why are they talking about pointers if there is no function of pointer in python can anyone answer that please

  • @ShubhamSinghYoutube
    @ShubhamSinghYoutube 3 ปีที่แล้ว

    Hashing is cool ~ Erik Demaine

  • @cparks1000000
    @cparks1000000 4 ปีที่แล้ว

    Where are the videos for 6046?
    EDIT: It was suggested for me one time. Here's the link for one video related to this: th-cam.com/video/z0lJ2k0sl1g/w-d-xo.html

  • @rafaaaaaaa1
    @rafaaaaaaa1 7 ปีที่แล้ว

    Could someone show me an implementation of 46:00?? Please

    • @rdwells
      @rdwells 7 ปีที่แล้ว

      Let M be your hash table size, which must be a power of 2, and let r be the integer such that M=2^r. Let a be the multiplier, and k is the hash of your key. Finally, let w be the size, in bits, of an int. Then
      h(k) = (((int)(a * k)) >> (w-r)) & (M-1)
      To break this down, you multiply the key by a, truncate that to an int (if your language doesn't already do that), and shift right enough to move the top r bits into the low-order bits. If your shift operator is logical (fills the top bits with zeroes), you can skip the final bitwise 'and'; otherwise, the 'and' is necessary to strip off any 1 bits resulting from an arithmetic shift of a negative number.

  • @katsunoppo
    @katsunoppo 11 ปีที่แล้ว +3

    he is handing pillows - see the first lecture of the series, there is some explanation

  • @cammiltaank
    @cammiltaank 7 ปีที่แล้ว

    At 28:30 Erik says m = O(n) is optimal, but would m = n + O(1) not be more optimal (based on what we know so far)?

    • @nayuki2020
      @nayuki2020 7 ปีที่แล้ว

      lmao. come on dude be nice

    • @cammiltaank
      @cammiltaank 7 ปีที่แล้ว

      I'm just curious if m = n + O(1), or if I have missed something. I realise that n is O(n). If we can state that the constant factor is 1 then why not?

    • @asshole9191
      @asshole9191 7 ปีที่แล้ว

      You misunderstood the big O notation. O(f(n)) means the following: we have an actual function g(n) whose values are all smaller or equal to c * f(n) for a constant c. This is, of course, only if you are bigger than a certain value n_0. If f(n) = 1, we only have c, thus g must be constant as well.
      If we write something like n + O(1) we mean that you add a constant to n, whatever that might be.

  • @louerleseigneur4532
    @louerleseigneur4532 4 ปีที่แล้ว

    merci

  • @akolec
    @akolec 6 ปีที่แล้ว

    Analysis begins at th-cam.com/video/0M_kIqhwbFo/w-d-xo.html