简历:The Google Resume: How to Prepare for a Career and Land a Job at Apple, Microsoft, Google, or any Top Tech Company
算法学习书籍:Introduction to Algorithms
编程珠玑:Programming Pearls (2nd Edition)
C++ 学习:The C++ Programming Language, 4th Edition
经典操作系统书籍,龙书:Operating System Concepts
创业:The Start-up of You: Adapt to the Future, Invest in Yourself, and Transform Your Career
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary tree
Given binary tree
{3,9,20,#,#,15,7}
,3 / \ 9 20
return its zigzag level order traversal as:[ [3], [20,9], [15,7] ]这题有一点儿意思,但和前面那个level traverse也是换汤不换药,顺序改变,于是我们就用stack来做就好了。
多谢楼主推荐的书籍!我最近开始刷题,但是感觉好难啊。。光这题我就足足想了3天。。最后还是来找答案了T_T
ReplyDelete