mirror of
https://github.com/CyC2018/CS-Notes.git
synced 2025-07-09 20:32:12 +08:00
修改代码
This commit is contained in:
@ -244,11 +244,10 @@ public String replaceSpace(StringBuffer str) {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
public ArrayList<Integer> printListFromTailToHead(ListNode listNode) {
|
public ArrayList<Integer> printListFromTailToHead(ListNode listNode) {
|
||||||
ArrayList<Integer> ret = new ArrayList<>();
|
if (listNode == null)
|
||||||
if (listNode != null) {
|
return new ArrayList<>();
|
||||||
ret.addAll(printListFromTailToHead(listNode.next));
|
ArrayList<Integer> ret = printListFromTailToHead(listNode.next);
|
||||||
ret.add(listNode.val);
|
ret.add(listNode.val);
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user