From d9bef6466049ae22a2dff098a7bb6bf88cd1c0a9 Mon Sep 17 00:00:00 2001 From: Omooo <869759698@qq.com> Date: Sun, 19 Jul 2020 10:08:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Update=20=E4=BA=8C=E5=8F=89=E6=A0=91?= =?UTF-8?q?=E7=9B=B8=E5=85=B3.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blogs/Algorithm/剑指 Offer/二叉树相关.md | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/blogs/Algorithm/剑指 Offer/二叉树相关.md b/blogs/Algorithm/剑指 Offer/二叉树相关.md index a46d742..e38fc0d 100644 --- a/blogs/Algorithm/剑指 Offer/二叉树相关.md +++ b/blogs/Algorithm/剑指 Offer/二叉树相关.md @@ -510,3 +510,47 @@ class Solution { } ``` +#### [Offer 54. 二叉搜索树的第k大节点](https://leetcode-cn.com/problems/er-cha-sou-suo-shu-de-di-kda-jie-dian-lcof/) + +```java +class Solution { + List list = new ArrayList<>(); + + public int kthLargest(TreeNode root, int k) { + helper(root); + return list.get(list.size() - k); + } + + private void helper(TreeNode root) { + if (root == null) { + return; + } + helper(root.left); + list.add(root.val); + helper(root.right); + } +} +``` + +```java +class Solution { + int result = 0, count = 1; + + public int kthLargest(TreeNode root, int k) { + helper(root, k); + return result; + } + + private void helper(TreeNode root, int k) { + if (root == null) { + return; + } + helper(root.right, k); + if (count++ == k) { + result = root.val; + return; + } + helper(root.left, k); + } +} +``` \ No newline at end of file From 1acdb6a9f5adf1a1abd83773d07fc4335e181c4a Mon Sep 17 00:00:00 2001 From: Omooo <869759698@qq.com> Date: Mon, 20 Jul 2020 08:29:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Create=20View=20=E4=BD=93=E7=B3=BB=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8F=A3=E6=B0=B4=E8=AF=9D.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blogs/Android/口水话/View 体系相关口水话.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 blogs/Android/口水话/View 体系相关口水话.md diff --git a/blogs/Android/口水话/View 体系相关口水话.md b/blogs/Android/口水话/View 体系相关口水话.md new file mode 100644 index 0000000..6c90ebe --- /dev/null +++ b/blogs/Android/口水话/View 体系相关口水话.md @@ -0,0 +1,16 @@ +--- +View 体系相关口水话 +--- + +#### 目录 + +1. View 绘制流程 +2. View 事件分发 +3. View 刷新机制 + +#### View 绘制流程 + +#### View 事件分发 + +#### View 刷新机制 +