Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Add a Bubblesort() method to the following LinkedList.java file: Please add othe

ID: 638016 • Letter: A

Question

Add a Bubblesort() method to the following LinkedList.java file:

Please add other appropriate methods/edits you think may be necessary

class Node{
       int data;
       public Node next;
       public Node (int data){
           this.data = data;

       }
   public void display(){
       System.out.println(data);
   }
  
}
   public class LinkedList
   {
   private Node head, previous, current;
   public LinkedList()
   {
       head = null;
   }
   public boolean isEmpty()
   {
       return( head==null);
   }
  
   public void insertFirst(int data)
   {
       Node newNode = new Node(data);
   newNode.next = head;
       head = newNode;
   }
   public Node deleteFirst()
   {
       Node temp = head;
       head = head.next;
       return temp;
   }
   public void displayList()
   {
       System.out.println("First to last: ");
       current = head;
       while(current != null)
       {
           current.display();
           current = current.next;
       }
       System.out.println("");
       }
  
   }

Explanation / Answer

public void bubbleSort { for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote