请问对于下面的代码,怎样能只在while补全代码,就能使该函数达到单链表反转的效果!请大家帮帮忙!
class Node {
int data;
Node next;
}
public Node reverse(Node head) {
Node newhead = null;
Node current = head;
while (current != null) {
}
return newhead;
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
闭关修行中......