摘要: 链接:https://leetcode-cn.com/problems/shu-de-zi-jie-gou-lcof/ 代码: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *le 阅读全文
posted @ 2020-02-25 19:38 景云ⁿ 阅读(171) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/he-bing-liang-ge-pai-xu-de-lian-biao-lcof/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int 阅读全文
posted @ 2020-02-24 17:47 景云ⁿ 阅读(94) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/fan-zhuan-lian-biao-lcof/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode * 阅读全文
posted @ 2020-02-24 17:41 景云ⁿ 阅读(77) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof/submissions/ 代码: class Solution { public: bool isNumber(string s) { if (s.emp 阅读全文
posted @ 2020-02-22 19:31 景云ⁿ 阅读(169) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/zheng-ze-biao-da-shi-pi-pei-lcof/ 思路: 状态表示:f[i][j] 表示s[i,..]与p[j,...]匹配 状态转换: 1.p[j]是正常字符,f[i][j] = s[i] == p[j] & 阅读全文
posted @ 2020-02-22 18:36 景云ⁿ 阅读(215) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/lian-biao-zhong-dao-shu-di-kge-jie-dian-lcof/ 代码: /** * Definition for singly-linked list. * struct ListNode { * i 阅读全文
posted @ 2020-02-21 16:52 景云ⁿ 阅读(85) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/ 思路: 快排partition 代码: class Solution { public: ve 阅读全文
posted @ 2020-02-21 16:45 景云ⁿ 阅读(104) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/shan-chu-lian-biao-de-jie-dian-lcof/submissions/ 代码: /** * Definition for singly-linked list. * struct ListNode { 阅读全文
posted @ 2020-02-21 10:26 景云ⁿ 阅读(80) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/da-yin-cong-1dao-zui-da-de-nwei-shu-lcof/ 代码: class Solution { public: vector<int> printNumbers(int n) { int res = 阅读全文
posted @ 2020-02-21 10:08 景云ⁿ 阅读(100) 评论(0) 推荐(0)
摘要: 链接:https://leetcode-cn.com/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/ 代码: class Solution { public: double myPow(double x, int n) { if(n == 0) return 阅读全文
posted @ 2020-02-20 20:57 景云ⁿ 阅读(159) 评论(0) 推荐(0)