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
Algorithm
(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!
=== By implementation === ; Recursion : A [[recursive algorithm]] invokes itself repeatedly until meeting a termination condition and is a common [[functional programming]] method. [[Iteration|Iterative]] algorithms use repetitions such as [[Program loops|loop]]s or data structures like [[Stack (data structure)|stack]]s to solve problems. Problems may be suited for one implementation or the other. The [[Tower of Hanoi]] is a puzzle commonly solved using recursive implementation. Every recursive version has an equivalent (but possibly more or less complex) iterative version, and vice versa. ; Serial, parallel or distributed : Algorithms are usually discussed with the assumption that computers execute one instruction of an algorithm at a time on serial computers. Serial algorithms are designed for these environments, unlike [[parallel algorithm|parallel]] or [[distributed algorithm|distributed]] algorithms. Parallel algorithms take advantage of computer architectures where multiple processors can work on a problem at the same time. Distributed algorithms use multiple machines connected via a computer network. Parallel and distributed algorithms divide the problem into subproblems and collect the results back together. Resource consumption in these algorithms is not only processor cycles on each processor but also the communication overhead between the processors. Some sorting algorithms can be parallelized efficiently, but their communication overhead is expensive. Iterative algorithms are generally parallelizable, but some problems have no parallel algorithms and are called inherently serial problems. ; Deterministic or non-deterministic : [[Deterministic algorithm]]s solve the problem with exact decisions at every step; whereas [[non-deterministic algorithm]]s solve problems via guessing. Guesses are typically made more accurate through the use of [[heuristics]]. ; Exact or approximate : While many algorithms reach an exact solution, [[approximation algorithm]]s seek an approximation that is close to the true solution. Such algorithms have practical value for many hard problems. For example, the [[Knapsack problem]], where there is a set of items, and the goal is to pack the knapsack to get the maximum total value. Each item has some weight and some value. The total weight that can be carried is no more than some fixed number X. So, the solution must consider the weights of items as well as their value.<ref>{{Cite book|url=https://www.springer.com/us/book/9783540402862|title=Knapsack Problems {{!}} Hans Kellerer {{!}} Springer|language=en|isbn=978-3-540-40286-2|publisher=Springer|year=2004|doi=10.1007/978-3-540-24777-7|access-date=September 19, 2017|archive-url=https://web.archive.org/web/20171018181055/https://www.springer.com/us/book/9783540402862|archive-date=October 18, 2017|url-status=live|last1=Kellerer|first1=Hans|last2=Pferschy|first2=Ulrich|last3=Pisinger|first3=David|s2cid=28836720 }}</ref> ; Quantum algorithm : [[Quantum algorithm]]s run on a realistic model of [[quantum computation]]. The term is usually used for those algorithms that seem inherently quantum or use some essential feature of [[Quantum computing]] such as [[quantum superposition]] or [[quantum entanglement]].
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)