21 Merge Two Sorted Lists(easy)

it2025-01-12  36

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.

合并两个排好序的List 采用两个指针记录两个List的下表,比较两个指针对映的元素的大小,小的元素加入最终的List并将指针往前移动,最后注意处理剩余的元素。

 

转载于:https://www.cnblogs.com/WegYcx/p/7873197.html

最新回复(0)