上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 46 下一页
摘要: 好久没写动态规划,中午听到学长们讨论的一道题,就是给出一组硬币面额,和一个目标数值,求有几种找零方式(想半天没想清楚)#include #include using namespace std;int count(int* s, int m, int n) { if (n == 0) retu... 阅读全文
posted @ 2014-05-08 23:48 卖程序的小歪 阅读(226) 评论(0) 推荐(0) 编辑
摘要: class Solution{ public: int maxArea(vector& height) { int len = height.size(), low = 0, high = len -1 ; int maxArea = 0; ... 阅读全文
posted @ 2014-05-08 09:56 卖程序的小歪 阅读(154) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: vector result;public: vector wordBreak(string s, unordered_set &dict) { vector > dp; result.clear(); ... 阅读全文
posted @ 2014-05-07 21:26 卖程序的小歪 阅读(272) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: int* memo;public: bool wordBreak(string s, unordered_set &dict) { memo = new int[s.length() + 1]; for (in... 阅读全文
posted @ 2014-05-06 16:12 卖程序的小歪 阅读(126) 评论(0) 推荐(0) 编辑
摘要: int sunday(string str, string pattern) { int str_len = str.length(); int pat_len = pattern.length(); int char_pos[256]; for (int i = 0... 阅读全文
posted @ 2014-05-06 15:27 卖程序的小歪 阅读(190) 评论(0) 推荐(0) 编辑
摘要: ```cppclass Solution {public: void connect(TreeLinkNode *root) { if (root == NULL) return; queue que; que.push(root); i... 阅读全文
posted @ 2014-05-06 09:51 卖程序的小歪 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
posted @ 2014-04-25 15:44 卖程序的小歪 阅读(163) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: vector > nodes;public: vector > levelOrderBottom(TreeNode *root) { nodes.clear(); dfs(root, 0); re... 阅读全文
posted @ 2014-04-25 14:36 卖程序的小歪 阅读(123) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: vector > nodes;public: vector > levelOrder(TreeNode *root) { nodes.clear(); dfs(root, 0); return n... 阅读全文
posted @ 2014-04-25 14:12 卖程序的小歪 阅读(231) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int search(int A[], int n, int target) { if (n last) { left = mid; } else { ... 阅读全文
posted @ 2014-04-23 22:50 卖程序的小歪 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 46 下一页