+ 1
Learning about complexity/timing for algorithms worth it?
I’ve been learning C. I have an ok grasp up to data structures. I still am figuring out pointers, LLs, etc as well. I have begun to move forward and branch into other areas as well. Data structures and cryptography seem to be my big end goal atm. I am interested in embedded C for electronics. Atm I have been watching and taking notes from MIT 6.006 on YouTube, which is about algorithm complexity. It seems to help to know the complexity with data structures. Just want to verify I am on the right path.
4 Antworten
+ 1
yes, for huge amounts of data, its EXTREMELY important to learn about time complexity, even though I dont use big data, I can definitely see the difference between a bubblesort O(n2) that takes over 2 hours to sort a 60*60 pixel field (10 per second) and a radixsort(kn) that takes 18 minutes to do the same
+ 1
yes, big O notation is indeed the same as time complexity
btw n2 is almost the worst sort of all since it takes (input*input) to sort everything
n is very fast, since it only has to loop through the input once
kn is a bit slower and its worst case is slower than n2, but only if the length of the biggest inputinde is larger than the input
n2 = inputlength * inputlength
kn stands for indexlength (abc = 3) * inputlength
and there are this kind of sorting algorithms that don't compare at all (forgot how they were called)
0
cool. Thanks for the answer. I just want to make sure I’m not over doing it atm.
I’m guessing I can find supplemental things with searching for Big O notation?
I am unsure if that is the same as time complexity.
0
cool thanks for the info.
I took Calc 1 in college so I understand the idea behind them a bit due to limits but I struggled with logarithmic equations.
I actually had to look up why n^2 was worse then nlogn and stackoverflow had a very good post on it.
https://stackoverflow.com/questions/23329234/which-is-better-on-log-n-or-on2
Thanks again for all the info. I really appreciate it.