Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Space complexity
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer memory needed by an algorithm}} The '''space complexity''' of an [[algorithm]] or a [[data structure]] is the amount of memory space required to solve an instance of the [[computational problem]] as a function of characteristics of the input. It is the memory required by an algorithm until it executes completely.<ref>{{citation|title=Optimal Reliability Modeling: Principles and Applications|first1=Way|last1=Kuo|first2=Ming J.|last2=Zuo|publisher=John Wiley & Sons|year=2003|isbn=9780471275459|url=https://books.google.com/books?id=vdZ4Bm-LnHMC&pg=PA62|page=62}}</ref> This includes the memory space used by its inputs, called '''input space''', and any other (auxiliary) memory it uses during execution, which is called '''auxiliary space'''. Similar to [[time complexity]], space complexity is often expressed asymptotically in [[big O notation|big ''O'' notation]], such as <math>O(n),</math> <math>O(n\log n),</math> <math>O(n^\alpha),</math> <math>O(2^n),</math> etc., where {{mvar|n}} is a characteristic of the input influencing space complexity.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)