mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 03:33:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			602 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			602 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>定义一个函数,输入一个链表的头节点,反转该链表并输出反转后链表的头节点。</p>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><strong>示例:</strong></p>
 | 
						|
 | 
						|
<pre><strong>输入:</strong> 1->2->3->4->5->NULL
 | 
						|
<strong>输出:</strong> 5->4->3->2->1->NULL</pre>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><strong>限制:</strong></p>
 | 
						|
 | 
						|
<p><code>0 <= 节点个数 <= 5000</code></p>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
 | 
						|
<p><strong>注意</strong>:本题与主站 206 题相同:<a href="https://leetcode-cn.com/problems/reverse-linked-list/">https://leetcode-cn.com/problems/reverse-linked-list/</a></p>
 |