标签:public scribe des 描述 next nbsp rom 从尾到头打印链表 div
/** * public class ListNode { * int val; * ListNode next = null; * * ListNode(int val) { * this.val = val; * } * } * */ import java.util.ArrayList; public class Solution { ArrayList<Integer> list = new ArrayList<>(); public ArrayList<Integer> printListFromTailToHead(ListNode listNode) { if(listNode != null ){ printListFromTailToHead(listNode.next); list.add(listNode.val); } return list; } }
标签:public scribe des 描述 next nbsp rom 从尾到头打印链表 div
原文地址:https://www.cnblogs.com/goodtest2018/p/12701422.html