摘要: 24. 两两交换链表中的节点 力扣题目链接 基本思路 迭代,注意指针模拟操作,定义虚拟头节点用来指向链表 递归 迭代 class Solution { public ListNode swapPairs(ListNode head) { ListNode dummy = new ListNode(0 阅读全文
posted @ 2024-12-05 22:43 xloading 阅读(28) 评论(0) 推荐(0)