Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void BubbleSort()
- {
- DoubleLink lastEnd = new DoubleLink();
- while (lastEnd != null)
- {
- Boolean swapped = false;
- DoubleLink link = First;
- while (link !=null){
- if (link == Last || link == lastEnd)
- {
- lastEnd = link;
- break;
- }
- if (link.Naw.CompareTo(link.Next.Naw) == 1)
- {
- SwapLinkWithNext(link);
- swapped = true;
- }
- link = link.Next;
- }
- if (swapped == false )
- {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement