随笔分类 - 算法学习
个人求职所遇到的算法
摘要:#include #include #include #include #include using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right...
阅读全文
摘要:Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For exmple:Given the below binary tree, Return6. 翻
阅读全文
摘要:Say you have an array for which the i th element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may compl
阅读全文
摘要:从尾到头,可以通过栈临时存储:
阅读全文
摘要:该文章转载于:http://www.cnblogs.com/wdan2016/p/5988560.html // test20.cpp : 定义控制台应用程序的入口点。//
阅读全文