Hash table appreciation thread

Sup Forumsive me one good reason hash tables with dynamic resizing and open double hashing are not the best data structure

(hint u cant)

benefits over arrays with enum indices:
>can use string functions to dynamically generate key names if necessary
>negligible performance hit if u pick an good func

benefits over search trees:
>constant time element access, insertion, and deletion
>who the fuck gives a shit about iteration time

Other urls found in this thread:

pastebin.com/X4jzhmfK
twitter.com/SFWRedditVideos

>open double hashing
shit i meant closed double hashing
open double hashing doesn't even make sense what the fuck

I prefer cuck hashing

Keeping objects in order.

>about iteration time
It's a linear time.

You're either extending insert times or wasting memory to prevent a worst case.

PHP.

>using words of reasonable large length
>typing all correctly
>cannot type "you" properly

What did he mean by this?

This is the most autistic thing I've seen in a few days on here.

cache

>cache locality

umm, no sweetie. Hash tables are used by ALL the popular js frameworks, so we should respect that arrays are way too hard to use for people with actual JOBS instead of anime watching NEETs.

yeah, linear in the width of the table, there's an overhead inversely proportional to the load factor

but like i said who cares, it's fucking associative

>is sarcastic and condescending
>agrees

wat

>Keeping objects in order.
lol what kind of neet needs to keep objects in order in an associative container

if u need ur objects in order just store them serially and use the fact that they're in order to speed up access

>I prefer cuck hashing
well then it sound like u...
R AN CUK
(ba dum, ba dun..............)

deliberate retardation aside these are both good points

u win hte an cats

PIK BRED

I can't, I use dictionaries and hashtables constantly.

>basic data structures
>most autistic thing I've seen

[doing fizzbuzz wrong intensifies]

I'm not going to be convinced by someone who talks like a nigger retard.

>slow and shit
> best data structure

>benefits over arrays
top kek homey

>umm, no sweetie

>fizzbuzz
had to google
why is this hard??
it's literally just
bool div3, div5;
for (int i = 1; i

>slow and shit
no it fast ????????

>Had to Google fizzbuzz
Good job proving his point

but i'm op, not the other guy

I just don't know what to believe any more

what are you even saying

better method, avoids the double testing problem inherent to using ifs

for (int i = 1; i

>switch (0)
NOPE
STOPPED READING, GOODBYE, LEAVING BUILDING

Why do you use so many constants in your expression?

Because there's only one fizz buzz problem.

If there were a chance I'd need the same functionality in other code, I'd certainly abstract out the constants. But there isn't.

test.cpp:9:24: error: the value of ā€˜iā€™ is not usable in a constant expression
case (i % 3): printf("Fizz");


help

>not switch(i)

the best data structure is the hash table where buckets are linked lists

simple and robust

did I do it right?
pastebin.com/X4jzhmfK

is it array based?

no? then it's slow

ayy lmao

I think double hashing is overkill and simply using a linked list for collisions is sufficient for 99.9% of cases and uses less memory than double hashing by comparison.

>It's so hard to keep an array or linked list of keys in whatever order you want

High memory usage if you keep it i memory.

High hard drive usage if you keep in on the hard drive. Extremely painful rebuilding operation in this case, too, when it grows too large.

Trees still have uses.

shit
why did c have that restriction on switch statements it's so stupid holy shit

switch (i) wouldn't work
you COULD try switch (i % 15); 0 means divisible by both, 3 6 9 or 12 means by 3, 5 or 10 means by 5; but idk

>is it array based?
Yes, you dumb shit. That's what a hash table is.

>no? then it's slow
see above

My dad just cooked me some hash browns and sausage. Does your hash browns have sausage, Sup Forums?

>tfw ur sausage is not yet implemented

Anyone have resources about special purpose hashes?
Stuff like magic bitboards and zobrist hashing seem nice to practice coding with.

this...using separate chaining for duplicates is the way to go

Hashtables sound great... How do I program a hashtable in HTML?