public static void insertValueSorted(LinkedListNode head, int value)
    {
        LinkedListNode n = new LinkedListNode(value);
        
        if (head == null)
        {
            head = n;
        }
        
        if (head.getNext() == null)
        {
            if ((int)head.getData() < value)
            {
                n.setNext(head);
            }
            else
            {
                head.setNext(n);
            }
        }
        else
        {
            while (head.getNext() != null && 
                    (int)head.getNext().getData() < value)
            {
                head = head.getNext();
            }
            
            if (head.getNext() != null)
            {
                LinkedListNode temp = head.getNext();
                head.setNext(n);
                n.setNext(temp);
            }
            else
            {
                head.setNext(n);
            }
        }
        
    }