摘要: // 求二叉树的深度和宽度.cpp : 定义控制台应用程序的入口点。#include "stdafx.h"#include #include using namespace std;struct BTNode{ char m_value; BTNode *m_left; BTNode *m_righ... 阅读全文
posted @ 2015-09-22 21:55 Vae永Silence 阅读(334) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the... 阅读全文
posted @ 2015-09-22 21:54 Vae永Silence 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 轻松搞定面试中的二叉树题目版权所有,转载请注明出处,谢谢!http://blog.csdn.net/walkinginthewind/article/details/7518888树是一种比较重要的数据结构,尤其是二叉树。二叉树是一种特殊的树,在二叉树中每个节点最多有两个子节点,一般称为左子节点和右... 阅读全文
posted @ 2015-09-22 21:48 Vae永Silence 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2015-09-22 21:41 Vae永Silence 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 二叉树前序遍历:/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x... 阅读全文
posted @ 2015-09-22 21:26 Vae永Silence 阅读(244) 评论(0) 推荐(0) 编辑