Merge branch 'master' of https://github.com/CyC2018/InterviewNotes
This commit is contained in:
commit
ac1bf623f0
|
@ -194,6 +194,17 @@ public String replaceSpace(StringBuffer str) {
|
|||
## 6. 从尾到头打印链表
|
||||
|
||||
**题目描述**
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
输入一个链表的头结点,从尾到头反过来打印出每个结点的值。
|
||||
|
||||
**解题思路**
|
||||
|
||||
典型的"后进先出",可使用栈或者递归。
|
||||
|
||||
正向遍历然后调用 Collections.reverse()。
|
||||
>>>>>>> 073df8eb999741108a5f6c9e0800d25f6ca39af9
|
||||
|
||||
输入链表的第一个节点,从尾到头反过来打印出每个结点的值。
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user