Talk:Sort stability: Difference between revisions
→J and stability?
(reply re J stability) |
|||
Line 10:
<lang j> /: 'adfafb'
0 3 5 1 2 4</lang>
This is the grade and tells us that to sort the list in ascending order we'd arrange the list by its indices as shown. In this case the equal elements of y are the two a's and the two f's. The a's have indices 0 & 3, the f's have indices 2 & 4. The elements of /:y that select equal elements of y appear in ascending order so the 0 appears before the 3 in the grade and the 2 appears before the 4. Hope that helps! --[[User:tikkanz|Tikkanz]]
<lang j> NB. sort txt by txt without the first 4 columns
txt /: 4&}."1 txt
Line 18:
US New York
</lang>
|