随笔分类 -  算法学习

个人求职所遇到的算法
摘要:#include #include #include #include #include using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right... 阅读全文
posted @ 2017-06-16 10:37 Forever-Road 阅读(291) 评论(0) 推荐(0)
摘要: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. 翻 阅读全文
posted @ 2017-06-10 10:57 Forever-Road 阅读(255) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2017-06-10 10:47 Forever-Road 阅读(136) 评论(0) 推荐(0)
摘要:从尾到头,可以通过栈临时存储: 阅读全文
posted @ 2017-03-01 21:29 Forever-Road 阅读(561) 评论(0) 推荐(0)