mxplx

Big O Continued

Published by ideonexus

Subject

Simple Explanation of Big O Notation

The simplest definition I can give for Big-O notation is this: Big-O notation is a relative representation of the complexity of an algorithm. There are some important and deliberately chosen words in that sentence: relative: you can only compare apples to apples. You can't compare an algorithm to do arithmetic multiplication to an algorithm that sorts a list of integers. But two algorithms that do arithmetic…
Place/Position

Object

Simple Explanation of Big O Part II

So if you want to find a name in a phone book of a million names you can actually find any name by doing this at most 20 times. In comparing search algorithms we decide that this comparison is our 'n'. For a phone book of 3 names it takes 2 comparisons (at most). For 7 it takes at most 3. For 15 it takes 4. ... For 1,000,000 it takes 20. That is staggeringly good isn't it? In Big-O terms this is O(log n) or…

Why they relate

Linking the two memes into one complete explanation.