/g/ive 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
>>59425622
>open double hashing
shit i meant closed double hashing
open double hashing doesn't even make sense what the fuck
I prefer cuck hashing
>>59425622
Keeping objects in order.
>>59425622
>about iteration time
It's a linear time.
You're either extending insert times or wasting memory to prevent a worst case.
>>59425622
PHP.
>>59425622
>using words of reasonable large length
>typing all correctly
>cannot type "you" properly
What did he mean by this?
>>59425622
This is the most autistic thing I've seen in a few days on here.
>>59425622
cache
>>59425622
>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.
>>59426144
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
>>59428205
>is sarcastic and condescending
>agrees
wat
>>59426125
>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
>>59425773
>I prefer cuck hashing
well then it sound like u...
R AN CUK
(ba dum, ba dun..............)
>>59426181
>>59428164
deliberate retardation aside these are both good points
u win hte an cats
PIK BRED
>>59425622
I can't, I use dictionaries and hashtables constantly.
>>59428161
>basic data structures
>most autistic thing I've seen
[doing fizzbuzz wrong intensifies]
>>59425622
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
>>59428205
>umm, no sweetie
>>59428364
>fizzbuzz
had to google
why is this hard??
it's literally justbool div3, div5;
for (int i = 1; i <= 100; i++) {
div3 = !(i % 3);
div5 = !(i % 5);
if (div3) std::cout << "Fizz";
if (div5) std::cout << "Buzz";
if (!(div3 || div5)) std::cout << i;
std::cout << std::endl;
}
like are people just dumb or
>>59428417
>slow and shit
no it fast ????????
>>59428474
>Had to Google fizzbuzz
Good job proving his point
>>59428541
but i'm op, not the other guy
>>59428550
I just don't know what to believe any more
>>59428205
what are you even saying
>>59428474
better method, avoids the double testing problem inherent to using ifsfor (int i = 1; i <= 100; i++) {
switch (0) {
case (i % 3): std::cout << "Fizz";
case (i % 5): std::cout << "Buzz"; break;
default: std::cout << i;
}
std::cout << std::endl;
}
>>59428613
>switch (0)
NOPE
STOPPED READING, GOODBYE, LEAVING BUILDING
>>59428691
Why do you use so many constants in your expression?
>>59428705
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.
>>59428613test.cpp:9:24: error: the value of āiā is not usable in a constant expression
case (i % 3): printf("Fizz");
help
>>59428613
>not switch(i)
the best data structure is the hash table where buckets are linked lists
simple and robust
>>59428364
did I do it right?
http://pastebin.com/X4jzhmfK
>>59428486
is it array based?
no? then it's slow
>>59428705
ayy lmao
>>59425622
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.
>>59426125
>It's so hard to keep an array or linked list of keys in whatever order you want
>>59425622
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.
>>59428734
shit
why did c have that restriction on switch statements it's so stupid holy shit
>>59428763
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
>>59429103
>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, /g/?
>>59430961
>tfw ur sausage is not yet implemented
>>59425622
Anyone have resources about special purpose hashes?
Stuff like magic bitboards and zobrist hashing seem nice to practice coding with.
>>59429763
this...using separate chaining for duplicates is the way to go
Hashtables sound great... How do I program a hashtable in HTML?