Template:Infobox algorithm

From HandWiki
Revision as of 14:39, 11 July 2021 by imported>Jworkorg (import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Infobox algorithm
Class{{{class}}}
Data structure{{{data}}}
Worst-case performance{{{time}}}
Worst-case space complexity{{{space}}}
Template documentation

Usage

{{Infobox algorithm
|name           = <!-- Defaults to article name -->
|class          = <!-- Name of problem it solves -->
|image          =
|caption        =
|data           =
|time           = <!-- Worst time big-O notation -->
|best-time      =
|average-time   =
|space          = <!-- Worst-case space complexity; auxiliary space
                       (excluding input) if not specified -->
}}

Infobox describing an algorithm

Template parameters

ParameterDescriptionTypeStatus
Namename

Name of algorithm

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

Type of problem it solves

Example
Sorting
Auto value
Contentrequired
Imageimage

no description

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