Rick Quatro [rick at rickquatro.com] wrote: > I have a series of nested lists and am looking to sub sort each level in > reverse order. Below is how the lists "look"; I have included a flat version > and an indented version. Any advice on sorting algorithms would be > appreciated. > .... > Before > 1 > 2 > 3 > 3.1 > 3.2 > 3.3 > 3.3.1 > 3.3.2 > 3.3.3 > 3.3.3.1 > 3.3.3.2 > 3.3.3.3 > 3.3.3.3.1 > 3.3.3.3.2 > 4 > 4.1 > 4.2 > 5 > > After > 5 > 4 > 4.2 > 4.1 > 3 > 3.3 > 3.3.3 > 3.3.3.3 > 3.3.3.3.2 > 3.3.3.3.1 > 3.3.3.2 > 3.3.3.1 > 3.3.2 > 3.3.1 > 3.2 > 3.1 > 2 > 1
Pad right with "Z": 1ZZZZZZZZ 2ZZZZZZZZ 3ZZZZZZZZ 3.1ZZZZZZ 3.2ZZZZZZ 3.3ZZZZZZ 3.3.1ZZZZ 3.3.2ZZZZ 3.3.3ZZZZ 3.3.3.1ZZ 3.3.3.2ZZ 3.3.3.3ZZ 3.3.3.3.1 3.3.3.3.2 4ZZZZZZZZ 4.1ZZZZZZ 4.2ZZZZZZ 5ZZZZZZZZ Sort in descending order: 5ZZZZZZZZ 4ZZZZZZZZ 4.2ZZZZZZ 4.1ZZZZZZ 3ZZZZZZZZ 3.3ZZZZZZ 3.3.3ZZZZ 3.3.3.3ZZ 3.3.3.3.2 3.3.3.3.1 3.3.3.2ZZ 3.3.3.1ZZ 3.3.2ZZZZ 3.3.1ZZZZ 3.2ZZZZZZ 3.1ZZZZZZ 2ZZZZZZZZ 1ZZZZZZZZ Remove the Zs: 5 4 4.2 4.1 3 3.3 3.3.3 3.3.3.3 3.3.3.3.2 3.3.3.3.1 3.3.3.2 3.3.3.1 3.3.2 3.3.1 3.2 3.1 2 1 -Andrew
