Follow

some charts about computational complexity i've just come across.

like them because i find them pretty clear

@jartigag It is, but it's as simple as it looks.

@ekaitz_zarraga i guess i think there's a lot to learn about it because there are many data structures and algorithms, so there are a lot of combinations to consider.

i might study about the simplest ones some day. it sounds logical if you think about it for a moment

@jartigag @ekaitz_zarraga This is basically a type of math, doesnt get more logical than this ;)

@jartigag its an awesome overview... super cool.. thanks for sharing

@felix why is faster? i mean, how to determine which will be better for small sets?

@jartigag You benchmark it. Big-O complexity is something really theoretical, it doesnt have a lot to do with reality, unless you work with huge datasets.

I learned this stuff in university, and I didnt need it a single time in my life as programmer .

@felix @jartigag Big-O notation, by its nature, reduces the actual scaling equation to only a single term and removes "small" terms. N^2 is bigger than 25N when N=100, but when N < 25, N^2 is smaller.

The reason why, e.g., sorting with insertion sort is faster than merge sort for small lists, is that computers are good at moving blocks of memory so rotations aren't *quite* as slow as might be expected, and pushing and popping the stack to recurse isn't so fast.

@jartigag one of the things i learned how to do in my CS class was calculating big o from the code itself

haven't done any complicated ones yet though, that's probably for my algorithms class

haven't done any complicated ones yet though, that's probably for my algorithms class

jartigag@jartigag@mastodon.sociali don't know pretty much about this topic. if you've studied it, do you think it's a good overview?