示例
这一debug是我在做力扣206——反转链表,运用堆栈的方法实现时遇到的,如果小伙伴们对这道题没有思路的话,可以看我的博客力扣206:反转链表【C++】,有写这道题的解法。
以下是当时遇到问题时的程序段:
class Solution {
public:
ListNode* ReverseList(ListNode* pHead) {
stack<ListNode*>stk;//创建堆栈
ListNode* temp=(ListNode*)malloc