Anonymous user
Sort a list of object identifiers: Difference between revisions
Task description: Improve formatting, wording, and be explicit about the specification
(→{{header|Perl 6}}: add shorter solution) |
(Task description: Improve formatting, wording, and be explicit about the specification) |
||
Line 1:
{{draft task}}
[[wp:Object identifier|Object identifiers (OID)]] are strings used to identify objects in network data.
{{task heading}}
Show how to sort a list of OIDs naturally.
{{task heading|Details}}
* An OID consists of one or more non-negative integers in base 10, separated by dots.
* Their natural sort order is [[wp:Lexicographical|lexicographical]] with regard to the dot-separated fields, using numeric comparison between fields.
".1.3.6.1.4.1.11.2.17.19.3.4.0.10",▼
".1.3.6.1.4.1.11150.3.4.0.2",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.19",▼
".1.3.6.1.4.1.11150.3.4.0.1",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.22",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.2",▼
".1.3.6.1.4.1.11150.3.4.0.11",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.1",▼
".1.3.6.1.4.1.11.2.17.3773.0.2",▼
".1.3.6.1.4.1.11.2.17.19.2.0.79",▼
".1.3.6.1.4.1.11150.3.4.0.21",▼
".1.3.6.1.4.1.11.2.17.19.2.0.9",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.25",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.32",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.4",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.31",▼
".1.3.6.1.4.1.11.2.17.19.3.4.0.3",▼
".1.3.6.1.4.1.11.2.17.3773.0.1"▼
{{task heading|Test case}}
{| class="wikitable"
# 01 | .1.3.6.1.4.1.11.2.17.19.2.0.9 |▼
|-
# 02 | .1.3.6.1.4.1.11.2.17.19.2.0.79 |▼
! Input ''(list of strings)''
# 03 | .1.3.6.1.4.1.11.2.17.19.3.4.0.1 |▼
! Output ''(list of strings)''
# 04 | .1.3.6.1.4.1.11.2.17.19.3.4.0.2 |▼
|-
# 05 | .1.3.6.1.4.1.11.2.17.19.3.4.0.3 |▼
|
# 06 | .1.3.6.1.4.1.11.2.17.19.3.4.0.4 |▼
|
|}
{{task heading|Related tasks}}
* [[Natural sorting]]
<hr>
=={{header|C++}}==
|