当前位置: 代码迷 >> 综合 >> 【leetcode】高频题目整理_树结构篇( High Frequency Problems, Tree )
  详细解决方案

【leetcode】高频题目整理_树结构篇( High Frequency Problems, Tree )

热度:78   发布时间:2024-02-25 03:09:55.0

截止至今LeetCode题目总量已经有1582题,估计将来每年平均增长300题左右,大部分人肯定是刷不完的,所以得有选择地刷LeetCode。

一种公认的刷题策略是按类别刷题,可是每个类别也有许多题,在有限的时间里到底该刷哪些题呢?个人根据LeetCode官方给出的每个题目的出现频率,整理并收录了每个类别里高频出现的题目,对于官方统计频率太低的题目,不予收录,最终得到了这个高频题目表格。

例如,对于下图中题号#275#270的题目将被收录,并且#275出现频率大于#270;而对于题号#1011#1182的题目,因为出现频率太低,将不被收录:在这里插入图片描述

撸起键盘加油干!祝大家成功上岸!整理不易,点个赞吧!


树结构篇-82题(Tree, 82 problems)

数据日期: 2020/03/26 (此时LeetCode题目数量:1582)
数据来源: LeetCode官方,将不同类别的题目按照官方给的出现频率(Frequency)降序排列,取有频率统计的题。

排序 题号 题目 通过率 难度
1 #95 Unique Binary Search Trees II 0.623 中等
2 #94 Binary Tree Inorder Traversal 0.707 中等
3 #96 Unique Binary Search Trees 0.652 中等
4 #226 Invert Binary Tree 0.745 简单
5 #104 Maximum Depth of Binary Tree 0.726 简单
6 #108 Convert Sorted Array to Binary Search Tree 0.699 简单
7 #617 Merge Two Binary Trees 0.755 简单
8 #107 Binary Tree Level Order Traversal II 0.647 简单
9 #543 Diameter of Binary Tree 0.49 简单
10 #114 Flatten Binary Tree to Linked List 0.681 中等
11 #105 Construct Binary Tree from Preorder and Inorder Traversal 0.646 中等
12 #101 Symmetric Tree 0.506 简单
13 #687 Longest Univalue Path 0.394 简单
14 #654 Maximum Binary Tree 0.798 中等
15 #655 Print Binary Tree 0.553 中等
16 #449 Serialize and Deserialize BST 0.51 中等
17 #199 Binary Tree Right Side View 0.639 中等
18 #257 Binary Tree Paths 0.63 简单
19 #102 Binary Tree Level Order Traversal 0.613 中等
20 #144 Binary Tree Preorder Traversal 0.648 中等
21 #669 Trim a Binary Search Tree 0.646 简单
22 #538 Convert BST to Greater Tree 0.596 简单
23 #124 Binary Tree Maximum Path Sum 0.397 困难
24 #112 Path Sum 0.493 简单
25 #145 Binary Tree Postorder Traversal 0.707 困难
26 #501 Find Mode in Binary Search Tree 0.441 简单
27 #100 Same Tree 0.569 简单
28 #530 Minimum Absolute Difference in BST 0.56 简单
29 #222 Count Complete Tree Nodes 0.678 中等
30 #111 Minimum Depth of Binary Tree 0.418 简单
31 #637 Average of Levels in Binary Tree 0.637 简单
32 #437 Path Sum III 0.545 简单
33 #173 Binary Search Tree Iterator 0.718 中等
34 #337 House Robber III 0.564 中等
35 #653 Two Sum IV - Input is a BST 0.544 简单
36 #404 Sum of Left Leaves 0.542 简单
37 #110 Balanced Binary Tree 0.509 简单
38 #776 Split BST 0.552 中等
39 #99 Recover Binary Search Tree 0.559 困难
40 #863 All Nodes Distance K in Binary Tree 0.477 中等
41 #103 Binary Tree Zigzag Level Order Traversal 0.54 中等
42 #563 Binary Tree Tilt 0.537 简单
43 #684 Redundant Connection 0.571 中等
44 #235 Lowest Common Ancestor of a Binary Search Tree 0.629 简单
45 #515 Find Largest Value in Each Tree Row 0.585 中等
46 #297 Serialize and Deserialize Binary Tree 0.458 困难
47 #236 Lowest Common Ancestor of a Binary Tree 0.608 中等
48 #513 Find Bottom Left Tree Value 0.688 中等
49 #606 Construct String from Binary Tree 0.527 简单
50 #652 Find Duplicate Subtrees 0.527 中等
51 #113 Path Sum II 0.589 中等
52 #106 Construct Binary Tree from Inorder and Postorder Traversal 0.675 中等
53 #508 Most Frequent Subtree Sum 0.627 中等
54 #230 Kth Smallest Element in a BST 0.694 中等
55 #129 Sum Root to Leaf Numbers 0.624 中等
56 #662 Maximum Width of Binary Tree 0.358 中等
57 #783 Minimum Distance Between BST Nodes 0.52 简单
58 #98 Validate Binary Search Tree 0.295 中等
59 #572 Subtree of Another Tree 0.439 简单
60 #671 Second Minimum Node In a Binary Tree 0.459 简单
61 #450 Delete Node in a BST 0.392 中等
62 #250 Count Univalue Subtrees 0.619 中等
63 #685 Redundant Connection II 0.335 困难
64 #623 Add One Row to Tree 0.505 中等
65 #116 Populating Next Right Pointers in Each Node 0.564 中等
66 #998 Maximum Binary Tree II 0.593 中等
67 #255 Verify Preorder Sequence in Binary Search Tree 0.458 中等
68 #333 Largest BST Subtree 0.421 中等
69 #1008 Construct Binary Search Tree from Preorder Traversal 0.717 中等
70 #117 Populating Next Right Pointers in Each Node II 0.464 中等
71 #988 Smallest String Starting From Leaf 0.442 中等
72 #270 Closest Binary Search Tree Value 0.506 简单
73 #549 Binary Tree Longest Consecutive Sequence II 0.473 中等
74 #582 Kill Process 0.346 中等
75 #156 Binary Tree Upside Down 0.73 中等
76 #285 Inorder Successor in BST 0.607 中等
77 #272 Closest Binary Search Tree Value II 0.587 困难
78 #666 Path Sum IV 0.585 中等
79 #366 Find Leaves of Binary Tree 0.73 中等
80 #536 Construct Binary Tree from String 0.513 中等
81 #545 Boundary of Binary Tree 0.349 中等
82 #298 Binary Tree Longest Consecutive Sequence 0.54 中等

相关/参考链接

leetcode-cn
leetcode

  相关解决方案