Template:Infobox algorithm: Difference between revisions

Content deleted Content added
Edit templatedata
m typo
 
(9 intermediate revisions by 4 users not shown)
Line 1:
{{Infobox
| headerstyle = background:#ffc0c0
| title = {{{name|{{PAGENAMEBASE}}}}}
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image size|{{{image_size|{{{imagesize|}}}}}}}}}|alt={{{alt|}}}}}
| caption = {{{caption|}}}
| label1 = Class
| data1 = {{{class|}}}
| label2 = Data structure
| data2 = {{{data|}}}
| label3 = [[Best, worst and average case|Worst-case]] [[Time complexity|performance]]
| data3 = {{{time|}}}
| label4 = [[Best, worst and average case|Best-case]] [[Time complexity|performance]]
| data4 = {{{best-time|}}}
Line 15:
| data5 = {{{average-time|}}}
| label6 = [[Best, worst and average case|Worst-case]] [[space complexity]]
| data6 = {{{space|}}}
| label7 = Optimal
}}<noinclude>
| data7 = {{{optimal|}}}
{{Documentation|content=
}}{{#invoke:Check for unknown parameters|check|unknown={{main other|}}|preview=Page using [[Template:Infobox algorithm]] with unknown parameter "_VALUE_"|ignoreblank=y | name | image | image size | image_size | imagesize | alt | class | image | caption | data | time | best-time | average-time | space | optimal}}<noinclude>
== Usage ==
{{documentation}}<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
<pre>
{{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 -->
}}
</pre>
<templatedata>
{
"description": "Infobox for an algorithm",
"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 it operates on",
"type": "content",
"example": "Array"
},
"time": {
"label": "Worst-case time complexity",
"description": "Worst-case time complexity in big O notation",
"type": "content",
"required": true,
"suggested": true
},
"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
},
"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",
"caption",
"data",
"time",
"best-time",
"average-time",
"space",
"alt"
]
}
</templatedata>
}}
[[Category:Computer science infobox templates|Algorithm]]
</noinclude>