当前位置:网站首页>合并两个有序链表
合并两个有序链表
2022-08-03 08:08:00 【charlsdm】
public ListNode MergeTwoLists(ListNode l1, ListNode l2)
{
if (l1 == null)
return l2;
else if (l2 == null)
return l1;
else if (l1.val < l2.val)
{
l1.next = MergeTwoLists(l1.next, l2);
return l1;
}
else
{
l2.next = MergeTwoLists(l1, l2.next);
return l2;
}
}
边栏推荐
猜你喜欢
随机推荐
pyspark---encode the suuid interval (based on the number of exposures and clicks)
vim 折叠函数
开发工具之版本控制
001-进程与线程
Mysql的in和exists用法区别
推荐系统-排序层-模型:Wide&Deep
volta管理node版本
获取JDcookie的方法
sqlite date field plus one day
WPS EXCEL 筛选指定长度的文本 内容 字符串
Windows安装MySQL(MIS)
千万级别的表分页查询非常慢,怎么办?
The use of the database table structure document generation tool screw
BOM系列之localStorage
Transformer、BERT、GPT 论文精读笔记
热部署系统实现
内存模型之有序性
AcWing 3391. 今年的第几天?(简单题)
JS函数获取本月的第一天和最后一天
xshell开启ssh端口转发,通过公网机器访问内网机器









