How big does a aarray have to get before it turns into a hash map

How big does a aarray have to get before it turns into a hash map

Beware Cat Shirt $21.68

Rise, Grind, Banana Find Shirt $21.68

Beware Cat Shirt $21.68

  1. 2 years ago
    Anonymous

    As big as my interest in wearing that cute top.

  2. 2 years ago
    Anonymous

    >he doesn't know that hashmaps are implemented as arrays

  3. 2 years ago
    Anonymous

    at least 1

  4. 2 years ago
    Anonymous

    Post in stupid questions general

    Or don't because this is really stupid

  5. 2 years ago
    Anonymous

    There's no algorithm connecting the position of an element in the array to that element. Searching the array is linear, whereas searching a hash is constant (usually). While hashmaps can be implemented as arrays, arrays are not automatically hashmaps

    • 2 years ago
      Anonymous

      >whereas searching a hash is constant (usually)
      Is this due to because how there is only one way the hash goes into the array without being modified, because of the call to the array function, it's not in an array?

      • 2 years ago
        Anonymous

        Idk how to parse what your saying
        Just watch a video on havshing almost, it's not complicated

      • 2 years ago
        Anonymous

        sauce?

        • 2 years ago
          Anonymous

          That's a man

          • 2 years ago
            Anonymous

            Not what he asked

          • 2 years ago
            Anonymous

            he's got some nice breasts. i want to nakadashi him/her

        • 2 years ago
          Anonymous
          • 2 years ago
            Anonymous

            love from kazakhstan

      • 2 years ago
        Anonymous

        What a cutie, damn

    • 2 years ago
      Anonymous

      >arrays are not automatically hashmaps
      Unless you use PHP

  6. 2 years ago
    Anonymous

    wat

  7. 2 years ago
    Anonymous

    You are asking the wrong question. Here is the questions you should be asking:
    What is an array? What is a hash map? This may take a few hours to understand.

  8. 2 years ago
    Anonymous

    Any amount. A hash map is always an array its just an array with rules. Its an array that you index by using a key that you hash and then you divide that result by the length of the array and the remainder is the index that you put the value into. The longer the array the less likely you'll get a hash collision. I am not sure the optimal size, but most are just implemented as btrees so you don't have to allocate as much memory. A hash collision is when two different keys get the same index in the array. The longer the array the less likely it becomes.

  9. 2 years ago
    Anonymous

    it depends on your hash function but if you imagine its free, bigger than 2x the size of a cache line.

    • 2 years ago
      Anonymous

      what if my hash function is the identity function and i only allow unsigned integers as keys

      • 2 years ago
        Anonymous

        then you very lucky

  10. 2 years ago
    Anonymous

    You should learn Arrays better before working with Hash Maps based on how you asked this question. Matter of fact, you should learn English better before Programming.

  11. 2 years ago
    Anonymous

    >hash
    none for me, thanks.

    • 2 years ago
      Anonymous

      What's that poop turd doing next to the hash and weed

      • 2 years ago
        Anonymous

        How old are you?

    • 2 years ago
      Anonymous

      What's that BBC doing next to the hash and weed

  12. 2 years ago
    Anonymous

    Ara Array

  13. 2 years ago
    Anonymous

    a million

  14. 2 years ago
    SHIT ASS

    SAUCE

  15. 2 years ago
    Anonymous

    how long is too long for a clit?

  16. 2 years ago
    Anonymous
  17. 2 years ago
    Anonymous

    An array is a thing, a hashmap is another thing, their definitions do not depend on size.

    A map of size 1 with key % 2 is still a map.

    An array of size 99 billion is still an array and will segfault if I give it uint64_t(-1)

    • 2 years ago
      Anonymous

      >will segfault if I give it uint64_t(-1)
      incorrect, it's size_t(-1)

  18. 2 years ago
    Effeminate faggot nigger

    WHOMST

  19. 2 years ago
    Anonymous

    a hashmap is an array fricktard

  20. 2 years ago
    Anonymous

    Hash table is a dynamic array where indexes can be any hashable values.

  21. 2 years ago
    Anonymous

    Arrays are a kind of mapping where the keys are elements of a compact range of integers, usually starting at 0 or 1 (depending on language). Implementations usually use some variety of address arithmetic to turn the index into where to get the storage cell that holds the value in question; computers are fantastically good at this.
    Hash maps are mappings where the keys are not so restricted, requiring only that they support value equality, and that they have some deterministic function for turning them into an integer (the "hash" function) that has the property that any two values that are equal will have the same hash value computed for them by the hash function. The hash function does not have to be bijective; the length of a string could be used as a (low-quality) hash function for strings. (Internally, hash maps use the hash function to project the key to an array index. And then do trickery to handle collisions, which is why they also require equality. You wanna know how? Look up the implementations.)
    It's not strictly required for hash keys to be constant, but it's a really good plan to make them so; modifiable keys can only ever safely equal themselves, and so are a bit useless.
    The other major type of mapping found in the wild is an ordered tree, usually a balanced ordered tree (only madmen don't balance that sort of tree). That doesn't require a hash function, but does require an ordering function on the keys instead. The right choice of ordering function isn't always obvious.

Your email address will not be published. Required fields are marked *