Difference between revisions of "Template:Infobox algorithm"

From blackwiki
Jump to navigation Jump to search
imported>Fuhghettaboutit
imported>Enervation
(Edit templatedata)
 
(27 intermediate revisions by 26 users not shown)
Line 1: Line 1:
 
{{Infobox
 
{{Infobox
 
| headerstyle = background:#ffc0c0
 
| headerstyle = background:#ffc0c0
| title        = {{{name|{{PAGENAME}}}}}
+
| title        = {{{name|{{PAGENAMEBASE}}}}}
| image       = {{{image}}}
+
| image     = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|alt={{{alt|}}}}}  
 
| caption      = {{{caption|}}}
 
| caption      = {{{caption|}}}
 
| label1        = Class
 
| label1        = Class
Line 8: Line 8:
 
| label2        = Data structure
 
| label2        = Data structure
 
| data2        = {{{data}}}
 
| data2        = {{{data}}}
| label3        = [[Best, worst and average case|Worst case performance]]
+
| label3        = [[Best, worst and average case|Worst-case]] [[Time complexity|performance]]
| data3       = {{{time}}}
+
| data3         = {{{time}}}
| label4        = [[Best, worst and average case|Best case performance]]
+
| label4        = [[Best, worst and average case|Best-case]] [[Time complexity|performance]]
| data4       = {{{best-time|}}}
+
| data4         = {{{best-time|}}}
| label5        = [[Best, worst and average case|Average case performance]]
+
| label5        = [[Best, worst and average case|Average]] [[Time complexity|performance]]
 
| data5        = {{{average-time|}}}
 
| data5        = {{{average-time|}}}
| label6        = [[Best, worst and average case|Worst case space complexity]]
+
| label6        = [[Best, worst and average case|Worst-case]] [[space complexity]]
 
| data6        = {{{space}}}
 
| data6        = {{{space}}}
}}<noinclude>{{-}}<pre>
+
}}<noinclude>
{{Infobox Algorithm
+
{{Documentation|content=
|name= <!-- Defaults to article name -->
+
== Usage ==
|class= <!-- Name of problem it solves -->
+
<pre>
|image=
+
{{Infobox algorithm
|caption=
+
|name           = <!-- Defaults to article name -->
|data=
+
|class         = <!-- Name of problem it solves -->
|time= <!-- Worst time big-O notation -->
+
|image         =
|best-time=
+
|caption       =
|average-time=
+
|data           =
|space=
+
|time           = <!-- Worst time big-O notation -->
 +
|best-time     =
 +
|average-time   =
 +
|space         = <!-- Worst-case space complexity; auxiliary space
 +
                      (excluding input) if not specified -->
 
}}
 
}}
 
</pre>
 
</pre>
[[Category:Software infobox templates|Algorithm]]
+
<templatedata>
 
+
{
[[it:Template:Infobox Algoritmo]]
+
"description": "Infobox describing an algorithm",
[[uk:Шаблон:Картка алгоритм]]
+
"params": {
 +
"name": {
 +
"label": "Name",
 +
"description": "Name of algorithm",
 +
"type": "content",
 +
"required": true,
 +
"default": "{{PAGENAMEBASE}}",
 +
"autovalue": "{{PAGENAMEBASE}}",
 +
"suggested": true
 +
},
 +
"class": {
 +
"label": "Problem class",
 +
"description": "Type of problem it solves",
 +
"type": "content",
 +
"required": true,
 +
"example": "Sorting",
 +
"autovalue": "",
 +
"suggested": true
 +
},
 +
"image": {
 +
"type": "content",
 +
"label": "Image"
 +
},
 +
"caption": {
 +
"type": "content",
 +
"label": "Caption"
 +
},
 +
"data": {
 +
"label": "Data structure",
 +
"description": "Data structure operated upon",
 +
"type": "content",
 +
"example": "Array",
 +
"required": true,
 +
"suggested": true
 +
},
 +
"time": {
 +
"label": "Worst-case time complexity",
 +
"description": "Worst-case time complexity in big O notation",
 +
"type": "content",
 +
"required": true,
 +
"suggested": true,
 +
"example": "O(n)"
 +
},
 +
"best-time": {
 +
"label": "Best-case time complexity",
 +
"type": "content"
 +
},
 +
"average-time": {
 +
"label": "Average time complexity",
 +
"type": "content"
 +
},
 +
"space": {
 +
"label": "Worst-case space complexity",
 +
"required": true,
 +
"description": "If not specified, this should be auxiliary space complexity and not include the space needed for the input",
 +
"type": "content",
 +
"suggested": true,
 +
"example": "O(1)"
 +
},
 +
"alt": {
 +
"label": "Alt text",
 +
"description": "Alt text for image",
 +
"type": "string"
 +
},
 +
"size": {
 +
"aliases": [
 +
"image size",
 +
"imagesize",
 +
"image_size"
 +
],
 +
"label": "Image size"
 +
}
 +
},
 +
"paramOrder": [
 +
"name",
 +
"class",
 +
"image",
 +
"size",
 +
"alt",
 +
"caption",
 +
"data",
 +
"time",
 +
"best-time",
 +
"average-time",
 +
"space"
 +
]
 +
}
 +
</templatedata>
 +
}}
 +
[[Category:Computer science infobox templates|Algorithm]]
 
</noinclude>
 
</noinclude>

Latest revision as of 23:49, 11 August 2020

Template:PAGENAMEBASE
Class{{{class}}}
Data structure{{{data}}}
Worst-case performance{{{time}}}
Worst-case space complexity{{{space}}}

[[Category:Infobox templates|Template:Remove first word]]

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