Skip to content

Commit 928b780

Browse files
committed
JAVA 知识体系
1 parent 9114a59 commit 928b780

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/algorithm/study/demo/algorithm/Jianzhi02.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ public void printListInverselyUsingIteration() {
7979
*单链表反转
8080
*/
8181
public ListNode reversalNode(){
82+
//当前节点的上一个节点
8283
ListNode previousNode = null;
84+
//当前节点
8385
ListNode currentNode = root;
86+
//返回反转后的节点
8487
ListNode headNode = null;
8588
while (currentNode != null) {
89+
//当前节点的下一个节点
8690
ListNode nextNode = currentNode.next;
8791
if (nextNode == null) {
8892
headNode = currentNode;

0 commit comments

Comments
 (0)