反轉一個單鏈表。 python

反轉一個單鏈表。 示例:python 輸入: 1->2->3->4->5->NULL 輸出: 5->4->3->2->1->NULLweb # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution:
相關文章
相關標籤/搜索