所以我试图让我的双链表做一个插入排序
我现在遇到问题,只是将节点移动到正确的位置。我已经进行了比较,但我的节点都没有移动。
public void insertionSort()
{
    Node temp;
    Node start = this.head.next;
    Node next = start.next;
    Node prev = this.head;
    while(start != this.head)
    {
        if(start.data.compareTo(next.data) > 0) //start is larger than next
        {
            temp = start;
            start = next;
            next = temp;
        }
        start = start.next;
        next = next.next;
        prev = prev.next;
    }
}
我想知道是否有人可以帮助我正确使用此算法。我正在使用循环双向链表来尝试测试各种排序例程的时间复杂度。