csnotes/370/notes/space.md
Medium Fries ea2aa8d2a6 yote
2019-03-15 01:26:26 -07:00

473 B

Space complexity

With function calls there is explicit space used.

Implicit space used is about how much work is done to take up space

Binary recursive search

Explicit space: O(c)

This is the amount of space taken per call. We know how much space has to be allocated every call so we can say it would likely be constant

Implicit: O(log(n))

Because again we will likely take up log(n) times to reach our destination an this comes from our rekked stackspace.