Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

思路:从尾到头打印链表 #3

Open
YZcxy opened this issue Apr 2, 2019 · 0 comments
Open

思路:从尾到头打印链表 #3

YZcxy opened this issue Apr 2, 2019 · 0 comments

Comments

@YZcxy
Copy link
Owner

YZcxy commented Apr 2, 2019

题目描述

输入一个链表,按链表值从尾到头的顺序返回一个ArrayList。

思路

链表是单向从头到尾的遍历,而题目要求从尾到头输出,这就是典型的后进先出模型,可以使用栈的特征,而递归模型本来就是栈,可以直接递归,但是需要注意调用栈的溢出问题,最好还是显示使用栈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant