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

Update 0739.每日温度.md #1340

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

huangyebiaoke
Copy link
Contributor

Java栈用LinkedList实现更快,因为默认的stack用的是Vector实现的,而Vector因为加锁了所以非常慢;

Stack<Integer> stack=new Stack<>();
16:34	info
			解答成功:
			执行耗时:189 ms,击败了27.62% 的Java用户
			内存消耗:53.3 MB,击败了47.34% 的Java用户
Deque<Integer> stack=new LinkedList<>();
16:27	info
			解答成功:
			执行耗时:25 ms,击败了69.42% 的Java用户
			内存消耗:56.8 MB,击败了19.39% 的Java用户

@youngyangyang04 youngyangyang04 merged commit 49a5d83 into youngyangyang04:master Jun 6, 2022
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

Successfully merging this pull request may close these issues.

2 participants