Merge pull request #556 from wangzeping722/master

修改代码
This commit is contained in:
CyC2018 2019-02-12 20:28:01 +08:00 committed by GitHub
commit 3cee26542b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -244,11 +244,10 @@ public String replaceSpace(StringBuffer str) {
```java
public ArrayList<Integer> printListFromTailToHead(ListNode listNode) {
ArrayList<Integer> ret = new ArrayList<>();
if (listNode != null) {
ret.addAll(printListFromTailToHead(listNode.next));
ret.add(listNode.val);
}
if (listNode == null)
return new ArrayList<>();
ArrayList<Integer> ret = printListFromTailToHead(listNode.next);
ret.add(listNode.val);
return ret;
}
```