Jump to content

Template:Infobox algorithm/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Hooman Mallahzadeh (talk | contribs) at 06:12, 5 May 2021 (Created page with '== Usage == <pre> {{Infobox algorithm |name = <!-- Defaults to article name --> |class = <!-- Name of problem it solves --> |image =...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Usage

{{Infobox algorithm
|name           = <!-- Defaults to article name -->
|class          = <!-- Name of problem it solves -->
|image          = <!-- filename only, no "File:" or "Image:" prefix, and no enclosing [[brackets]] -->
|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

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