Sorting a linked list

前端 未结 8 741
-上瘾入骨i
-上瘾入骨i 2020-11-29 09:26

I have written a basic linked list class in C#. It has a Node object, which (obviously) represents every node in the list.

The code does not use IEnumerable, however

8条回答
  •  迷失自我
    2020-11-29 10:27

    for(int i=0; icurrent.next.element)
        {
          Swap(current.elment,current.next.element);
        }
        current=current.next;
      }
    }
    

    increment counter when you add or insert elements to your linked lists

提交回复
热议问题