上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: 具体思路参见:二叉树的非递归遍历(转)先序遍历(根左右)。即把每一个节点当做根节点来对待。/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode ... 阅读全文
posted @ 2014-11-10 10:22 雄哼哼 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 原文地址,两种思路都不错第一种前序void preOrder(Node *p) //非递归{ if(!p) return; stack s; Node *t; s.push(p); while(!s.empty()) { t=s.top(); prin... 阅读全文
posted @ 2014-11-10 10:17 雄哼哼 阅读(5763) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2014-11-09 20:15 雄哼哼 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".思路:就是对首尾空格和中间连续空格的处理。为了方便处理,在s... 阅读全文
posted @ 2014-11-09 18:41 雄哼哼 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文
posted @ 2014-11-09 16:12 雄哼哼 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 应届生上泡了两年,一直都是下资料,下笔试题,面试题。一直都在感谢那些默默付出的人。写这个帖子花了我两 个夜晚的时间,不是为了炫耀,只是为了能给那些“迷惘”的学弟学妹,一点点建议而已。大家何必那么认真,更没必要说脏话。我不在乎你们怎么评价我。只要有 人觉得帖子有用,我就欣慰了。谢谢大家,别说脏话,以和... 阅读全文
posted @ 2014-11-07 15:25 雄哼哼 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 原文地址首先感谢师兄在两年前发的贴(【天道酬勤】 腾讯、百度、网易游戏、华为Offer及笔经面经 ),这篇文章对我帮助很大。我写这篇文章一是为了感谢这位同是华南理工但素未谋面的师兄,给我推荐这篇文章的炳爷,以及为我解决难题的浩子,羊兄给的项目帮助,洁洁的理解,王兄提供的两个月免费住宿,以及互娱的BO... 阅读全文
posted @ 2014-11-07 15:14 雄哼哼 阅读(751) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2014-11-06 17:38 雄哼哼 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an... 阅读全文
posted @ 2014-11-06 16:55 雄哼哼 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2014-11-06 16:50 雄哼哼 阅读(243) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页