Advanced Data Structures: Closed Addressing (Separate Chaining)

Поділитися
Вставка
  • Опубліковано 29 жов 2024

КОМЕНТАРІ • 7

  • @BlueBrendan2000
    @BlueBrendan2000 4 роки тому +13

    4:57 how did you manage to summarize my life in three seconds

  • @dkkogmaw1311
    @dkkogmaw1311 3 місяці тому

    but this approach leading to cache misses if we use linked lists for collisions or am I wrong?

    • @niemasd
      @niemasd  3 місяці тому

      Great insight! Yes, in practice, it is common to use an array-based structure (e.g. an Array List) as the separation chain, but it's ultimately up to the implementation

  • @isaacdouglas1119
    @isaacdouglas1119 3 роки тому

    Small clarification @ 9:50: wouldn't it be, a good load factor threshold for resizing the backing array ≈ 0.75?

    • @niemasd
      @niemasd  3 роки тому +1

      Yeah exactly: we should have never gone above a load factor of ~0.75 (we should have resized the backing array right away)

  • @DeadManProp
    @DeadManProp 3 роки тому

    Is a "cell" the same as a bucket, and if so, can it store more than one value before an overflow occurs?

    • @niemasd
      @niemasd  3 роки тому

      Yes, by "cell", I mean the same thing as "bucket", which is a specific single slot of the array. I'm not sure I understand the second part of your question; what do you mean by "an overflow occurs"? With separate chaining, each bucket is just a Linked List (or a different data structure if the developer prefers, but I'll stick with Linked List here), and each element "inserted into a given bucket" of the Hash Table is inserted into the Linked List in that bucket