Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
dmonkey21956yIt's all about calculus' limit operator.
Basically, if you say that a function is O( somef(n) ) it means that its limit for n -> +inf is lower than somef(n) but it's also asymptotically equal to it.
Formally, O( g(n) ) is a set of functions (let's call them f(n)) such that for each f(n) there exists at least one constant value c that makes
0 <= f(n) <= c*g(n) true.
(n is the length of your input, e.g. the length of an array)
If your function is a O(g(n)) that means that is asymptotically lower or equal to g(n), while Ω(n) means the opposite. Θ(n) means BOTH.
E.g. if my function is O(n^2) it means thay for big values of n it will take more or less n^2 time to execute.
This comment isn't enough to understand this concept (and I wasn't very precise).
Further readings: any algorithm book. -
feynman7806yThanks guys, I’ll crack it - just need to find some quite time to read it over and practice 👍🏼
Thanks for the feedback!
Related Rants
Anyone got some good links to introduce Big-O notation? I’m getting my head around it but still feel I’m missing the basics!
question
computer science
big-o