def reverse(head):
	if head == None or head.next == None:
		return head
	psuhead = ListNode(-1)
	while head:
		nexthead = head.next
		head.next = psuhead.next
		psuhead.next = head
		head = nexthead
	head = psuhead.next
	del psuhead
	return head

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2021-08-13
  • 2021-09-12
  • 2021-05-04
猜你喜欢
  • 2021-10-09
  • 2021-10-29
  • 2021-12-18
  • 2021-11-06
  • 2021-10-25
  • 2021-08-19
  • 2022-01-10
相关资源
相似解决方案