LeetCode206.反转链表
1.栈遍历法代码:public class Solution
{public ListNode ReverseList(ListNode head) {if (head null || head.next null) return head;Stack<ListNode> nodes new Stack<ListNode>();ListNode node head;while(node ! null){var temp node.next…
2026/8/1 12:17:20