Merge two non-decreasing sorted linked lists into one non-increasing sorted linked list

I can provide an idea: first, compare the head nodes of the two linked lists, add the smaller node to the resulting linked list, then move the pointer of the linked list where the node is located, and repeat the above steps until one of the linked lists reaches At the end, just add the remaining elements of the other linked list to the end of the resulting linked list.

Guess you like

Origin blog.csdn.net/weixin_42576410/article/details/129514457