会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
SomnusMistletoe
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
85
下一页
2020年3月28日
CF #629 Div.3 E(LCA)F
摘要: E 题意:给定一棵n个点的树,问是否能找到一条路径,使k个点要么在路径上,要么距路径长度为1。 分析:LCA #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<algorithm> #inclu
阅读全文
posted @ 2020-03-28 19:40 Somnuspoppy
阅读(138)
评论(0)
推荐(0)
2020年3月26日
LeetCode 653. Two Sum IV - Input is a BST(在BST中寻找两个节点,使它们的和为一个给定值)
摘要: 题意:在BST中寻找两个节点,使它们的和为一个给定值。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(in
阅读全文
posted @ 2020-03-26 00:12 Somnuspoppy
阅读(131)
评论(0)
推荐(0)
2020年3月25日
109. Convert Sorted List to Binary Search Tree(根据有序链表构造平衡的二叉查找树)
摘要: 题意:根据有序链表构造平衡的二叉查找树。 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL)
阅读全文
posted @ 2020-03-25 21:48 Somnuspoppy
阅读(114)
评论(0)
推荐(0)
108. Convert Sorted Array to Binary Search Tree(从有序数组中构造平衡的BST)
摘要: 题意:从有序数组中构造平衡的BST。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va
阅读全文
posted @ 2020-03-25 21:33 Somnuspoppy
阅读(118)
评论(0)
推荐(0)
2020年3月24日
LeetCode 236. Lowest Common Ancestor of a Binary Tree(二叉树求两点LCA)
摘要: 题意:二叉树求两点LCA。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x),
阅读全文
posted @ 2020-03-24 22:42 Somnuspoppy
阅读(103)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
85
下一页
公告