diff options
author | Michael Hunteman <michael@huntm.net> | 2023-09-23 12:53:46 -0500 |
---|---|---|
committer | Michael Hunteman <michael@huntm.net> | 2023-10-21 21:48:03 -0500 |
commit | 9891f38ddcca971fa21ab61e7a70832c8c877b0a (patch) | |
tree | 1e820435b42c5c8187bb6d17b3ff1c204c933c1a /complexity.md |
Diffstat (limited to 'complexity.md')
-rw-r--r-- | complexity.md | 14 |
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) |