私はプログラミングの初心者です。リンクされたリストの逆関数Javaの機能
Node reverse(Node node) {
Node prev = null;
Node current = node;
Node next = null;
while (current != null) {
next = current.next;
current.next = prev;
prev = current;
current = next;
}
node = prev;
return node;
}
whileループで何が起こっているのか正確に知りたいだけです。
ありがとうございます。
の可能性のある重複した[リンクリストのデータ構造のコードの反転に必要なビジュアル解説ガイダンス?](http://stackoverflow.com/questions/1482189/visual-explanation-guidance-needed-for-reversal- of-linked-list-datastructure-cod) –
codereviewで尋ねられませんか? –
@TamasHegedusは、Code Reviewのコードの仕組みを解説しています。そこの[トピック上のページ](http://codereview.stackexchange.com/help/on-topic)を参照してください。 – Phrancis