Dark Mode

Jump to content

Template:Infobox algorithm

From Wikipedia, the free encyclopedia
(Redirected from Template:Infobox Algorithm)
Infobox algorithm
Template documentation[view] [edit] [history] [purge]
This template uses Lua:

Example

Quicksort Algorithm

Quicksort Algorithm
Animated visualization of the quicksort algorithm. The horizontal lines are pivot values.
ClassSorting algorithm
Worst-case performanceO(n2)
Best-case performanceO(n log n) (simple partition)
or O(n) (three-way partition and equal keys)
Average performanceO(n log n)
Worst-case space complexityO(n) auxiliary (naive)
O(log n) auxiliary (Hoare 1962)
OptimalNo

Usage

{{Infobox algorithm
|name =
|class =
|image =
|caption =
|data =
|time =
|best-time =
|average-time =
|space =
}}

Infobox describing an algorithm

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Namename

Name of algorithm

Default
{{PAGENAMEBASE}}
Auto value
{{PAGENAMEBASE}}
Contentrequired
Problem classclass

Type of problem it solves

Example
Sorting
Auto value
Contentrequired
Imageimage

filename only, no 'File:' or 'Image:' prefix, and no enclosing [[brackets]]

Contentoptional
Image sizesize image size imagesize image_size

no description

Unknownoptional
Alt textalt

Alt text for image

Stringoptional
Captioncaption

no description

Contentoptional
Data structuredata

Data structure operated upon

Example
Array
Contentrequired
Worst-case time complexitytime

Worst-case time complexity in big O notation

Example
O(n)
Contentrequired
Best-case time complexitybest-time

no description

Contentoptional
Average time complexityaverage-time

no description

Contentoptional
Worst-case space complexityspace

If not specified, this should be auxiliary space complexity and not include the space needed for the input

Example
O(1)
Contentrequired
The above documentation is transcluded from Template:Infobox algorithm/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.