码迷,mamicode.com
首页 > 编程语言 > 详细

Java 逆序打印链表

时间:2017-10-13 12:38:03      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:out   java   style   null   cookie   public   nbsp   int   list   

递归

package cookie;

public class PrintListReversal {
    public void reversalOut(Node head) {
        if (head != null) {
            if (head.next != null) {
                reversalOut(head.next);
            }
            System.out.println(head);
        }
    }
}

 

Java 逆序打印链表

标签:out   java   style   null   cookie   public   nbsp   int   list   

原文地址:http://www.cnblogs.com/chenhuanBlogs/p/7660130.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!