Commit ff00d9e5 authored by michael lundquist's avatar michael lundquist
Browse files

Unsuccessful bubblesort, deleting it.

parent 46375cc3
Pipeline #3993 passed with stage
in 1 minute and 21 seconds
package com.ds.fourthassignment;
/**
* Code taken from class and used
* to do the assignment
*
* @author Michael Lundquist
* Email: mlundqu2@masonlive.gmu.edu
* G00737340
*/
public class TLinkedList {
private TNode head;
private int size;
......@@ -74,20 +82,16 @@ public class TLinkedList {
curNode.setNext(nextNode.getNext());
//System.out.println(curNode.getNext().getData().getName());
System.out.println("cur data: " + curNode.getData().getName());
nextNode.setNext(curNode);
if(prevNode != null){
prevNode.setNext(nextNode);
}
}else if(prevNode != null){
prevNode.setNext(curNode);
System.out.println("prev data: " + prevNode.getData().getName());
curNode = nextNode;
}
if(curNode.hasNext()){
prevNode = curNode;
curNode = curNode.getNext();
System.out.println("prev data: " + prevNode.getData().getName());
}
prevNode.setNext(nextNode);
System.out.println(toString());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment