Order two numerical lists: Difference between revisions

m
(→‎{{header|AutoHotkey}}: AutoHotkey example)
Line 6:
The order is determined by [[wp:Lexicographical order#Ordering of sequences of various lengths|lexicographic order]]: Comparing the first element of each list. If the first elements are equal, then the second elements should be compared, and so on, until one of the list has no more elements. If the first list runs out of elements the result is <code>true</code>. if the second list or both run out of elements the result is <code>false</code>.
=={{header|AutoHotkey}}==
{{works with|AutoHotkey_L}}
The function is overkill as we can just compare the list's ObjMaxIndex()
<lang AHK>List1 := [1,2,1,3,2]
Line 14 ⟶ 15:
return L1.MaxIndex() < L2.MaxIndex()
}</lang>
 
=={{header|C++}}==
The built-in comparison operators already do this: