Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

(smallestFirst()MethodContinue working with the same List.java class. Add void smallestFirst()method that moves the node with the smallest integer in...

(smallestFirst()MethodContinue working with the same List.java class. Add void smallestFirst()method that moves the node with the smallest integer in the list to become the first node.)

Below is what I have right now, I need to add smallestFirst()Method, i am in a hurry thank you very much!!!!!!!!!

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

List.java

package listdemo;

public class List {

  private class Node

  {

    int value;  

    Node next;    

    /**

      Constructor.       

      @param val The element to store in the node.

      @param n The reference to the successor node.

    */

    Node(int val, Node n)

    {

      value = val;

      next = n;

    } 

    /**

      Constructor. 

      @param val The element to store in the node.

    */

    Node(int val)

    {

      // Call the other (sister) constructor.

      this(val, null);       

    }

  }

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question