鏈表排序(歸併排序法)

ListNode *sortList(ListNode *head) { //鏈表歸併排序 if(head == nullptr || head->next == nullptr) return head; else{ //快慢指針找到中間節點 ListNode *fast = head,*slow = head;
相關文章
相關標籤/搜索