# 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

1. 1 week ago
Anonymous

As big as my interest in wearing that cute top.

2. 1 week ago
Anonymous

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

3. 1 week ago
Anonymous

at least 1

4. 1 week ago
Anonymous

Post in stupid questions general

Or don't because this is really stupid

5. 1 week 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

• 1 week 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?

• 1 week ago
Anonymous

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

• 1 week ago
Anonymous

sauce?

• 1 week ago
Anonymous

That's a man

• 1 week ago
Anonymous

• 1 week ago
Anonymous

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

• 1 week ago
Anonymous
• 1 week ago
Anonymous

love from kazakhstan

• 1 week ago
Anonymous

What a cutie, damn

• 1 week ago
Anonymous

>arrays are not automatically hashmaps
Unless you use PHP

6. 1 week ago
Anonymous

wat

7. 1 week 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. 1 week 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. 1 week ago
Anonymous

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

• 1 week ago
Anonymous

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

• 1 week ago
Anonymous

then you very lucky

10. 1 week 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. 1 week ago
Anonymous

>hash
none for me, thanks.

• 1 week ago
Anonymous

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

• 1 week ago
Anonymous

How old are you?

• 1 week ago
Anonymous

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

12. 1 week ago
Anonymous

Ara Array

13. 1 week ago
Anonymous

a million

14. 1 week ago
SHIT ASS

SAUCE

15. 1 week ago
Anonymous

how long is too long for a clit?

16. 1 week ago
Anonymous
17. 1 week 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)

• 1 week ago
Anonymous

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

18. 1 week ago
Effeminate faggot nigger

WHOMST

19. 1 week ago
Anonymous

a hashmap is an array fucktard

20. 1 week ago
Anonymous

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

21. 1 week 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.