nothing
This commit is contained in:
parent
341bea3c16
commit
e7684dedcd
1 changed files with 17 additions and 16 deletions
|
@ -81,19 +81,6 @@ public class Link
|
||||||
return new Link(obj);
|
return new Link(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertSorted(Link link)
|
|
||||||
{
|
|
||||||
if (siguiente==null)
|
|
||||||
siguiente = link;
|
|
||||||
else
|
|
||||||
if (link.toString().compareTo(siguiente.toString())<=0)
|
|
||||||
{
|
|
||||||
link.siguiente = siguiente;
|
|
||||||
siguiente = link;
|
|
||||||
}
|
|
||||||
else siguiente.insertSorted(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Link sort()
|
public Link sort()
|
||||||
{
|
{
|
||||||
Link newCabeza = (Link) clone(), next = next(), newLink;
|
Link newCabeza = (Link) clone(), next = next(), newLink;
|
||||||
|
@ -110,4 +97,18 @@ public class Link
|
||||||
}
|
}
|
||||||
return newCabeza;
|
return newCabeza;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void insertSorted(Link link)
|
||||||
|
{
|
||||||
|
if (siguiente==null)
|
||||||
|
siguiente = link;
|
||||||
|
else
|
||||||
|
if (link.toString().compareTo(siguiente.toString())<=0)
|
||||||
|
{
|
||||||
|
link.siguiente = siguiente;
|
||||||
|
siguiente = link;
|
||||||
|
}
|
||||||
|
else siguiente.insertSorted(link);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue