Algoritma: Béda antarrépisi
Konten dihapus Konten ditambahkan
m Bot: Ngaganti Abu_Abdullah_Muhammad_bin_Musa_al-Khwarizmi.jpg ku 1983_CPA_5426.jpg |
m Ngarapihkeun éjahan, replaced: nyaeta → nyaéta (2), make → maké (3), rea → réa (4), ea → éa (26), eo → éo, kabeh → kabéh using AWB |
||
Baris ka-3:
'''Algoritma''' nyaéta susunan paréntah, nu jumlahna kawates, pikeun ngolah sababaraha paréntah nu, sakumpulan data asupanana, bakal ngahasilkeun sarupaning bentuk ahir nu bisa dipikawanoh; sabalikna ti [[heuristik]]. Konsép algoritma mindeng digambarkeun ku conto hiji [[resép]], sanajan loba algoritma kacida ruwetna; algoritma sering miboga léngkah-léngkah anu malikan ([[iterasi]]) atawa merlukeun kaputusan (saperti [[logika Boolean|logika]] atawa [[kahenteusaruaan|perbandingan]]) nepi ka tugas diréngsékeunnana.
{{Tarjamahkeun|Inggris}}
sababaraha alogaritma bisa anggeus ku
Correctly performing an algorithm will not solve a problem if the algorithm is flawed or not appropriate to the problem. For example, performing the potato salad algorithm will fail if there are no potatoes present, even if all the motions of preparing the salad are performed as if the potatoes were there.
In some countries, such as the USA, some algorithms can effectively be [[
== Algoritma nu dirumuskeun ==
Baris ka-13:
specified task, such as calculating employees’ paychecks or printing students’ report cards. Thus, an algorithm can be considered to be any sequence of operations which can be performed by a [[Turing-complete]] system.
Typically, when an algorithm is associated with processing information, data is
For any such computational process, the algorithm must be rigorously defined: specified in the way it applies in all possible circumstances that could arise. That is, any conditional steps must be systematically
Because an algorithm is a precise list of precise steps, the order of computation will almost always be critical to the functioning of the algorithm. Instructions are usually assumed to be listed explicitly, and are described as starting 'from the top' and going 'down to the bottom', an
So far, this discussion of the formalisation of an algorithm has assumed the premises of [[imperative programming]]. This is the most common conception, and it attempts to describe a task in discrete, 'mechanical'
See [[functional programming]] and [[logic programming]] for alternate conceptions of what constitutes an algorithm.
Baris ka-26:
An '''algorithm''' is a method or procedure for carrying out a task (such as solving a problem in [[mathematics]], finding the freshest produce in a supermarket, or manipulating [[information]] in general).
Algorithms are sometimes implemented as [[computer program]]s but are more often implemented by other
The [[analysis of algorithms|analysis and study of algorithms]] is one discipline of [[computer science]], and is often practiced abstractly (without the use of a specific [[programming language]] or other implementation). In this sense, it resembles other mathematical disciplines in that the analysis focuses on the underlying principles of the algorithm, and not on any particular implementation. One way to embody (or sometimes ''codify'') an algorithm is the writing of [[pseudocode]].
Some writers restrict the definition of ''algorithm'' to procedures that eventually finish. Others include procedures that could run forever without stopping, arguing that some entity may be required to carry out such permanent tasks. In the latter case, success can no longer be defined in terms of halting with a
== Conto ==
Di dieu aya conto sederhana dina algoritma.
Bayangkeun anjeun mibanda wilangan random dina daptar nu teu kasortir. Tujuan ahirna keur manggihkeun wilangan panggedena tina
# Pretend the first number in the list is the largest number.
# Look at the next number, and compare it with this largest number.
# Only if this next number is larger, then keep that as the new largest number.
#
And here is a more formal coding of the algorithm in a [[pseudocode]] that is similar to most [[programming language]]s:
Baris ka-54:
Notes on notation:
* ''='' as used here indicates assignment. That is, the value on the right-hand side of the expression is assigned to the container (or variable) on the left-hand side of the expression.
* ''List[counter]'' as used here indicates the counter<sup>th</sup> element of the list. For example: if the value of ''counter'' is 5, then ''List[counter]'' refers to the
* ''<='' as used here indicates 'less than or equal to'
Note also the algorithm assumes that the list contains at
Most algorithms have similar assumptions on their inputs, called [[precondition|pre-conditions]].
As it happens, most
== Sajarah ==
[[Gambar:1983_CPA_5426.jpg|thumb|A tribute to the originator and namesake of algorithms]]
Kecap ''algoritma'' comes ultimately from the name of the [[9th century|
The first case of an algorithm written for a [[computer]] was [[Ada Lovelace|Ada Byron]]'s [[Ada Byron's notes on the analytical engine|notes on the analytical engine]] written in [[1842]], for which she is considered by many to be the world's first [[programmer]]. However, since [[Charles Babbage]] never completed his [[analytical engine]] the algorithm was never implemented on it.
The lack of [[mathematical rigor]] in the "well-defined procedure" definition of algorithms posed some difficulties for mathematicians and [[logic]]ians of the [[19th century|19th]] and
Nowadays, a formal criterion for an algorithm is that it is a procedure that can be implemented on a completely-specified Turing machine or one of the equivalent [[formalism]]s. Turing's initial interest was in the [[halting problem]]: deciding when an algorithm describes a terminating procedure. In practical terms [[computational complexity theory]] matters more: it includes the puzzling problem of the algorithms called [[NP-complete]], which are generally presumed to take more than polynomial time.
== Kelas algoritma ==
Aya sababaraha cara keur nyieun kelas algoritma, and the merits of
One way of classifying algorithms is by their design methodology or paradigm. There is a certain number of paradigms,
* Divide and conquer. A [[divide-and-conquer algorithm]] reduces an instance of a problem to one or more smaller instances of the same problem (usually [[recursion|recursively]]), until the instances are small enough to be directly expressible in the [[programming language]] employed (what is 'direct' is often discretionary).
* Dynamic programming. When a problem shows optimal substructure, i.e when the optimal solution to a problem consists of optimal solutions to subproblems (for instance the shortest path between two vertices on a weighted [[Graph (mathematics)|graph]] consists of the shortest path between all the vertices in between.) You solve such a problem bottom-up by solving the simplest problems first and then procceding to
* The greedy method. A [[greedy algorithm]] is similar to a [[Dynamic programming|dynamic programming algorithm]], but the difference is that at
*
*
* The probabilistic and heuristic paradigm. Algorithms belonging to this class fit the definition of an algorithm more loosely. [[Probabilistic algorithm]]s are those that
Another way to classify algorithms is by implementation. A [[recursive algorithm]] is one that invokes (makes reference to) itself
A [[list of algorithms]] discussed in Wikipedia is available.
|