Sort a list of object identifiers: Difference between revisions
Content added Content deleted
(Add Swift) |
|||
Line 753: | Line 753: | ||
data "1.3.6.1.4.1.11.2.17.19.3.4.0.1" |
data "1.3.6.1.4.1.11.2.17.19.3.4.0.1" |
||
data "1.3.6.1.4.1.11150.3.4.0" |
data "1.3.6.1.4.1.11150.3.4.0" |
||
M=Stack.Size-1 |
|||
While M>0 { |
|||
N=1 |
|||
For i=1 to |
For i=1 to M { |
||
\\ if peek item i > peek item i+1 then get i+1 to top, and send to i |
\\ if peek item i > peek item i+1 then get i+1 to top, and send to i |
||
\\ stack is a linked list, so moving items done with pointers only |
\\ stack is a linked list, so moving items done with pointers only |
||
if Gt(stackitem$(i), stackitem$(i+1)) then Shift i+1 : ShiftBack i : |
if Gt(stackitem$(i), stackitem$(i+1)) then Shift i+1 : ShiftBack i : N=i |
||
} |
} |
||
M=N-1 |
|||
} |
} |
||
While not empty { |
While not empty { |