What is a HashTable Data Structure - Introduction to Hash Tables , Part 0

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • This tutorial is an introduction to hash tables. A hash table is a data structure that is used to implement an associative array. This video explains some of the basic concepts regarding hash tables, and also discusses one method (chaining) that can be used to avoid collisions.
    Wan't to learn C++? I highly recommend this book amzn.to/1PftaSt
    Donate bit.ly/17vCDFx
    STILL NEED MORE HELP?
    Connect one-on-one with a Programming Tutor. Click the link below:
    trk.justanswer...
    :)

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

  • @LL-ue3ek
    @LL-ue3ek ปีที่แล้ว +29

    Many hash table videos explained it as if the listener already knew the basics, which is the worst way to teach. This video does not skip basics and gets down to the exact details that the beginners need to know to go further. Thank you very much!

  • @HawtDawg420
    @HawtDawg420 9 ปีที่แล้ว +528

    I never knew I had such feelings for triangle.

  • @xXGrandclosingXx
    @xXGrandclosingXx 9 ปีที่แล้ว +1702

    I cannot begin to explain how deeply disturbed and annoyed I am that he never once considered the shape triangle... like what the- I don't even...

    • @PaulProgramming
      @PaulProgramming  9 ปีที่แล้ว +423

      xXGrandclosingXx Haha! I don't know what I was thinking. I mean squiggly line and sideways squiggly line are really dear to me and I didn't want to leave them out. But triangle, no wonder I haven't heard from triangle all this time. I would call triangle to try and work things out, but I can't because I forgot to put triangle's contact info into my hash table. Oh I feel so bad now. :)

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

      Paul Programming I like using upside-down triangles when drawing out stuff too.

    • @alexxanderdimitrov
      @alexxanderdimitrov 9 ปีที่แล้ว +60

      +xXGrandclosingXx Illuminati not confirmed.

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

      +xXGrandclosingXx LOL I thought the same thing! :D

    • @joshrandall3663
      @joshrandall3663 8 ปีที่แล้ว +5

      +xXGrandclosingXx Bruh....same here LOOOL

  • @whoisbotsman
    @whoisbotsman 8 ปีที่แล้ว +405

    You went with "squiggly line" over triangle?! Dude...

  • @frankbush333
    @frankbush333 9 ปีที่แล้ว +1026

    classic programmer title "Part 0" ;)

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

      +Frank Bush i thought arrays start at -1

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

      +Frank Bush Or contemporary programmer. During the 1970s and up to the late 1980s, arrays typically started at index 1. We used languages like Algol, Pascal, Modula2, Ada, etc., many of which allowed you to choose an arbitrary range (such as _monday..friday_). It was typically only assembly programmers that used index 0 (i.e. until the C-like languages took over the whole industry).

    • @amidget159
      @amidget159 8 ปีที่แล้ว +11

      +Frank Bush real programmers start counting from 0 ;)

    • @frankbush333
      @frankbush333 8 ปีที่แล้ว +77

      +TheTanDoctor I have been a programmer for 20 years. Was just tryin' to be funny then it turned all academic...sigh

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

      I like Frank and his humor

  • @slimeb0y_
    @slimeb0y_ 8 ปีที่แล้ว +54

    I went through a 44 slide lecture on this topic for my class. I only understood like 20% of it. Then I found this video. It all slowly clicked. Thank you so much for this.

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

    Seriously thank you man. Our teacher in data structures and algo is slacking off.. He hasn't taught us anything the whole semester aside preliminations.. And he just assigns us to report the lessons in class.. basically we're just the ones teaching ourselves (and then the worse part is we're paying him).. But you sir, have my respect.. Liked!

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

    Thx a lot, just got my first job as developer and this vid helped me much more then wikipedia articles. More over english is not my native english, but your speech takes 100% clear and understandable.

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

    Instead of link lists, we can have root of a tree in the hashtable. If the number of elements become very large, then for searching in link lists, it will be O(n) whereas for binary search trees, we can search for a particular value from its hash index in O(log(n)).

  • @krzysztofkalinowski2998
    @krzysztofkalinowski2998 5 ปีที่แล้ว +43

    I was laughing so hard when i read all those pro triangle people comments :D

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

    I recently took a PluralSight course on Hashing, and I needed some extra high level perspective. When I saw this video, it really helped me to get the big picture a lot better. Thanks for teaching!

    • @RaigyoEcU
      @RaigyoEcU 11 หลายเดือนก่อน

      same here, trying to understand it from "The art of computer programming vol.3 " and it's so difficult to understand it there

  • @mellowvietnam
    @mellowvietnam 8 ปีที่แล้ว +205

    what do you have against triangles

  • @PaulProgramming
    @PaulProgramming  11 ปีที่แล้ว +45

    I think you guys are the best subscribers on all of TH-cam! I love reading all of your comments! Thanks for all the positive feedback!

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

      in your case its different because you worth

  • @sharjeelahmed7913
    @sharjeelahmed7913 5 ปีที่แล้ว +177

    Came in the comment section so I can see someone further explaining the matter but all I see is people crying over a "Triangle" like that shape is their Daddy

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

    I've been searching for explanations on Hash for about an hour and it's thanks to you that I finally got the concept. Thank you!

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

    I really learned a lot from these tutorials on Hash Tables. Thank You. Great Job.

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

    I appreciate you first explaining the concept on paper before jumping into code like a lot of youtubers tend to do

  • @jourdanbul-lalayao9445
    @jourdanbul-lalayao9445 9 ปีที่แล้ว +10

    "I hope that that was helpful to you guys"
    Yes, yes it was :) thanks for the video!

  • @juanlinde9028
    @juanlinde9028 5 ปีที่แล้ว +2

    Thanks for the illustration. It made things more easy to understand.

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

    Thanks Paul! Decided to go back to basics with distributed systems, so that I can fully understand them, and this was a perfect place to start :)

  • @chrissong1837
    @chrissong1837 ปีที่แล้ว

    to be honest, paul's video about hash table is the best I have meet

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

    Best tutorial on youtube :) But remember u guys the best learning is the best practising

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

    1 hour of class in 7 minutes. Thanks.

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

    This is the best intro video about hashtables I came across so far

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

    Whole day I have spent to understand the concept of hashing, but this video gives me precise and crisp idea. Now I can go further and read any example to understand Hashing. Thanks again and please send me more information and video on hashing if you have. Highly appreciated your effort!!!

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

    It has been more than 7 yrs now, still no triangle. RIP Triangle. :(

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

    Thanks for putting the time and energy into publishing and sharing your knowledge! Much appreciated!

  • @yiannisserpico2646
    @yiannisserpico2646 6 หลายเดือนก่อน +1

    Excellent explanation. Thanks Paul!!

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

    Paul We need more and more of data structures. I can not wait to see more. Thank you very much!

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

    Very helpful. Explanations are clear. Thank you so much. Great service to humanity indeed. Such services make average/beginners embrace programming with interest.

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

    Very clear explanation. And some updates about Java8, it uses a tree structure for each bucket instead of a linked list to enhance search performance.

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

    Very Good Sir..... you are Guru of HahsFunction ....

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

    Great video. The best part is that the concept is explained so beautifully and easily that even a kindergarten kid can understand it.

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

    This is absolutely one of the best explaining video of hash table by far, thank you so much!!!!!

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

    Sometimes us novice undergrads need the simple explanation. Thanks!

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

    Best description and application explanation for hashing I have seen!! Thanks

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

    I was waiting for Paul to draw a triangle hahaha

  • @jasonchunyeo
    @jasonchunyeo 9 ปีที่แล้ว +16

    he forgot one of the most basic shapes! triangle!
    i was waiting for him to use a triangle, but he never did. kinda disappointed, but will go cry about it offline.

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

    Omgggggg thank u sooooooooooooo much for this explanation! I'm a beginner and this really helped me to understand. Greatly appreciated!!!

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

    your explanation is much better than at the university. thank you very much!

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

    You made the complex thing look easier. Thank you.

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

    Diagrammatic explanation is very much use full.. Keep posting such videos in future..

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

    Very clear and concise explanation. You're a great teacher!

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

    best explanation on internet

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

    This is really good, I've watched multiple videos and it finally clicked after watching this video

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

    Awesome video, congratulations about it. I have never whatched such a simple and undestandable explanation of the hash tables and collisions.

  • @centrumsaiyan7623
    @centrumsaiyan7623 ปีที่แล้ว

    Awesome, I understood Hash tables from your video.

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

    Outstanding intro to hash tables, both extremely informative and accessible!

  • @MonstarChan3
    @MonstarChan3 8 ปีที่แล้ว +311

    No triangle? Illuminati unconfirmed.

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

      Triangle isn't a real shape. It's actually 3 very narrow rectangles in disguise....

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

      X-file theme song in the background.

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

      lmao

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

    Great explanation. My data structures text book made no since to me and the other videos I found online either went into too much detail or not enough detail. Thanks a lot Paul.

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

    Easy, clear and excellent video.

  • @ducksoop.x
    @ducksoop.x 6 ปีที่แล้ว

    You made my 3 hours data structures lecture much simpler.

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

    thank you, very good video and simplified instruction, even cavemen could learn this.

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

    When you said squiggly line, I immediately thought, "You mean The Artist Formerly Known as Prince". Anyways, good video!

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

    Thanks a lot man! I'm not kidding, it makes me expert with Hashing ! Now, I can do my school project. (Y)

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

      How was your school project?

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

      @@camtasia1000 I graduated as an honor student 👨‍🎓😁💯

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

    Great video. It`s so easy to understand with your explanations!Great job! It would be nice to see more videos about advanced data structures and algorithms.

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

    Here from a link in Udacity ALX Full Stack course

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

    Very well described, I completely understood it the first time through. Thank you!

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

    thank you sir i had understood the hash table structure i continue watching your tutorials really thank you very much sir

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

    That was very helpful. I am a visual person so that was a perfect explanation. Thanks!

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

    Simple and comprehensive explanation. It was helpful, thank you!

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

    Very Precise. Very simple. Easily understood. Good graphics. Subscribed.

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

    U the only one who made hash tables easy to learn 😍 thnxs alot ur a great👍🏻

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

    excellent explanation, simple and short.

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

    One of the Best Programming videos I have watched Thaks

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

    Paul, thanks for the very clear tutorial. I understood the lesson perfectly!

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

    i thought wow 940,000 views gotta view this and Mr Paul did not disappoint

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

      Prajjwal Singh Wow, I didn’t even realize it had that many views until you mentioned it! Happy to hear so many people are enjoying it!

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

    Thanks a lot Paul. You can make hard things a lot more easier to understand.

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

    Concise, as it should be, Thank you!

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

    Thank you for the clear explanation Paul

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

    finally a video with no indian accent !!!! in tears...

  • @abdelalimdebilou3238
    @abdelalimdebilou3238 ปีที่แล้ว

    I really enjoyed learning this thank you Paul

  • @arielwebster9064
    @arielwebster9064 9 ปีที่แล้ว +53

    Shape: Triangle.
    Thank you though.

  • @MiMi-po8zs
    @MiMi-po8zs 9 ปีที่แล้ว +37

    Great video :) Thanks.
    Question though, how do you know which value corresponds to that particular key if there are two other values taking up index 1?

    • @PaulProgramming
      @PaulProgramming  9 ปีที่แล้ว +64

      Jas Shih Each key value pair will have it's own node inside of index 1. For example if you are searching for the key "Jas Shih" then you will insert the key into the hash function like this.... hash("Jash Shih"); Then the hash function will direct you to the correct index. Once you get the index from the hash function, you can search the linked list of nodes in that index for the key "Jas Shih". Once you have found the node in that list containing the key, you can look at it's value.

    • @MiMi-po8zs
      @MiMi-po8zs 9 ปีที่แล้ว +12

      Thank you :)))

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

      @@PaulProgramming Won't it take O(n) to search the entire chained Linked List? I mean, ok, we get the index O(1) time, but we end up getting O(n) due to searching linked list. Isn't that so?

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

      @@hackzyoboy2459 yes, so what's your point here? You have other solutions? Like if you don't you linked lists then what'll be used?

  • @shubhamsingh-xw3tf
    @shubhamsingh-xw3tf 2 ปีที่แล้ว

    Appreciate the simple explanation. Thank you kind sir :)

  • @ivano.garcia5222
    @ivano.garcia5222 10 ปีที่แล้ว

    Thanks! Very clear and non-redundant tutorial!

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

    Triangle, Polygon, Parallelogram, Octagon, Heptagon, Hexagon, Trapezoid no.... wait for it.... squiggly lines. Also it would be of great value to explain how to write a hash function and best practices for collision avoidance. Good work.

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

    RIP Triangle (Beginning of time - 2013)

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

    This was extremely helpful Paul! You are doing brilliantly and you speak very clearly!

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

    Excellent - simple and extremely clear. Many thanks!

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

    Its straight forward and simple

  • @levyax1964
    @levyax1964 ปีที่แล้ว

    Everyone should click this video 1st before digging into other complicated intros.

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

    Nice Video Paul .. Explained in very easy terms .

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

    Don't stop making videos please.

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

    Brief explanation, good job. Thanks!

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

    Excellent video again. Really well explained. Keep them coming 👍

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

    Thanks for helping me understand hash tables!

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

    how can we retrieve the phone numbers if two persons have the same index value?...i mean there can be many ph. no.s at same index by chaining ...how do we know which phone number belong to whom?

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

    Hash tables are often used to convert RAM (random access memory) into content addressable memory (CAM, not to be confused with computer-aided design). This can be done in hardware at a high cost in chip complexity, but hash tables are the software version. Software is, of course, much slower.
    Hardware implementations are used in the translation lookaside buffers of memory cache systems because of the need for speed.

  • @LetsPG
    @LetsPG 3 หลายเดือนก่อน +2

    pual i have a quasteion : is hash tables share same index in the memory or something like that cus you have said that if we have multiple value in save index they will link to the same index with different key , i just wanna know that i leared that right

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

    Well done and thank you. I wanted to understand hashing better, and this video helped.

  • @asmaal-humaidi9553
    @asmaal-humaidi9553 10 ปีที่แล้ว +1

    Hi Paul, thank you ..the video was simple and helpful

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

    Easy to understand. Thank you

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

    That was too good man.Well explained!

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

    Thank you for an understandable overview of the topic.

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

    you make the best videos,very easy to understand. thanks for your good work.

  • @sakihayashi8325
    @sakihayashi8325 10 หลายเดือนก่อน

    the best explanation! Thank you so much!

  • @focusiam2027
    @focusiam2027 ปีที่แล้ว

    Paul = the plug! Thanks a lot!!

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

    Hey! Thanks, Paul. I really appreciate you taking the time to make this video. It was super helpful. I love you! :*

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

    Very nice explanation of hash tables, found it useful. Thank you