Java实现单链表的反转
public int value;
public Node next;
public Node(int data) {
value = data;
}
}
public static Node reverseLinkedList (Node head){
Node pre = null;
Node next = null;
while (head != null) {
next = head.next;
head.next = pre;
pre = head;
head = next;
}
return pre;
}
全部评论
相关推荐
01-07 20:03
蚌埠坦克学院 Java
李橙子:结果虽不够理想,但过程本身已是宝贵的淬炼。能把学习机会放在薪酬之前,证明你目光长远。先踏实进去,用这段时间扎实学好Python后端,把公司项目吃透,你的价值会在下一份工作中完全体现。这个起点,值得。 点赞 评论 收藏
分享
01-19 21:34
门头沟学院 测试开发 点赞 评论 收藏
分享
查看1道真题和解析