summaryrefslogtreecommitdiff
path: root/complexity.md
diff options
context:
space:
mode:
Diffstat (limited to 'complexity.md')
-rw-r--r--complexity.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/complexity.md b/complexity.md
new file mode 100644
index 0000000..9327bb4
--- /dev/null
+++ b/complexity.md
@@ -0,0 +1,14 @@
+# Time Complexity
+
+## Big O
+
+Big O is a way to categorize an algorithm's time or memory requirements based on
+input. It is not meant to be an exact measurement. It will not tell you how many
+CPU cycles it takes, instead it is meant to generalize the growth of the
+algorithm as the input grows.
+
+- Look for loops
+- Constants are dropped (Big O describes the upper bound or growth of the
+ algorithm where the constant eventually becomes irrelevant)
+- We often only consider worst case (e.g., searching through a list where the
+ element you want is the last one)