please help me complete the sort method in java

Suppose you have a linked list class that stores integers. The integers can be both negative and positive. Based on the following class definition, give the pseudocode or the Java code for the sort() method, which sorts the list.

public class SortedIntegerList { protected static class Node {

Node next; int value;


private Node head;

public SortedIntegerList() { } public void append(int value) {

Node n = new Node(); n.value = value;

if (head == null) { head = n;

} else {

Node tmp = head;

while ( != null) { tmp =;

} = n;



public void sort() {




"Order a similar paper and get 100% plagiarism free, professional written paper now!"

Order Now