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
Time 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!
== Linear time == An algorithm is said to take '''linear time''', or <math>O(n)</math> time, if its time complexity is <math>O(n)</math>. Informally, this means that the running time increases at most linearly with the size of the input. More precisely, this means that there is a constant {{mvar|c}} such that the running time is at most <math>cn</math> for every input of size {{mvar|n}}. For example, a procedure that adds up all elements of a list requires time proportional to the length of the list, if the adding time is constant, or, at least, bounded by a constant. Linear time is the best possible time complexity in situations where the algorithm has to sequentially read its entire input. Therefore, much research has been invested into discovering algorithms exhibiting linear time or, at least, nearly linear time. This research includes both software and hardware methods. There are several hardware technologies which exploit [[Parallel computing|parallelism]] to provide this. An example is [[content-addressable memory]]. This concept of linear time is used in string matching algorithms such as the [[Boyer–Moore string-search algorithm]] and [[Ukkonen's algorithm]].
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)