From e7684dedcd0dd9e12f4aef48e6d4d2d4a3ba9eaa Mon Sep 17 00:00:00 2001 From: amontano Date: Sat, 5 Apr 2003 00:03:44 +0000 Subject: [PATCH] nothing --- source/org/thdl/util/Link.java | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/source/org/thdl/util/Link.java b/source/org/thdl/util/Link.java index 5d9dc1f..29a3124 100644 --- a/source/org/thdl/util/Link.java +++ b/source/org/thdl/util/Link.java @@ -81,6 +81,23 @@ public class Link return new Link(obj); } + public Link sort() + { + Link newCabeza = (Link) clone(), next = next(), newLink; + while (next!=null) + { + newLink = (Link) next.clone(); + if (newLink.toString().compareTo(newCabeza.toString())<=0) + { + newLink.siguiente = newCabeza; + newCabeza = newLink; + } + else newCabeza.insertSorted(newLink); + next = next.next(); + } + return newCabeza; + } + public void insertSorted(Link link) { if (siguiente==null) @@ -94,20 +111,4 @@ public class Link else siguiente.insertSorted(link); } - public Link sort() - { - Link newCabeza = (Link) clone(), next = next(), newLink; - while (next!=null) - { - newLink = (Link) next.clone(); - if (newLink.toString().compareTo(newCabeza.toString())<=0) - { - newLink.siguiente = newCabeza; - newCabeza = newLink; - } - else newCabeza.insertSorted(newLink); - next = next.next(); - } - return newCabeza; - } } \ No newline at end of file