Advertisement
nocturnalmk

Untitled

Nov 28th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1.                 SLLNode<String> tmp = current.firstChild;
  2.                     SLLNode<String> tmp2;
  3.                    
  4.                     while (tmp.sibling != null) {
  5.                         tmp2 = tmp.sibling;
  6.                         while (tmp2 != null) {
  7.                             if (tmp.element.compareTo(tmp2.element) > 0) {
  8.                                
  9.                                 SLLNode<String> tmp3 = current.firstChild;
  10.                                 while (tmp3.sibling != tmp) {
  11.                                     tmp3 = tmp3.sibling;
  12.                                 }
  13.                                
  14.                                 tmp3.sibling = tmp2;
  15.                                 tmp2.sibling = tmp.sibling;
  16.                                 tmp.sibling.sibling = tmp;
  17.                                 tmp.sibling = tmp2.sibling;
  18.                                
  19.                             }
  20.                            
  21.                             tmp2 = tmp2.sibling;
  22.                         }
  23.                        
  24.                         tmp = tmp.sibling;
  25.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement