年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
青否云后端云 - wallimn
- vipbooks
- gashero
- wy_19921005
- benladeng5225
- fantaxy025025
- zysnba
- e_e
- javashop
- sam123456gz
- tanling8334
- arpenker
- kaizi1992
- xpenxpen
- lemonhandsome
- xiangjie88
- ganxueyun
- xyuma
- wangchen.ily
- jh108020
- Xeden
- johnsmith9th
- zxq_2017
- zhanjia
- jbosscn
- forestqqqq
- ajinn
- daizj
- wjianwei666
- ranbuijj
- 喧嚣求静
- sichunli_030
- kingwell.leng
- silverend
- lchb139128
- kristy_yy
- lich0079
- jveqi
- lzyfn123
- java-007
- sunj
- yeluowuhen
- lerf
- flashsing123
- xiaoxinye
- lxguy
- zhangjijun
最新文章列表
Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.
Note:
You may assume k is always valid, 1 ≤ k ≤ BST's total elements.
给定一个二叉搜索树,从中找到第k小的元素。根据二叉搜索树的性质 ...
Binary Search Tree Iterator
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest number in the BST.
Note: next() and ...
Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
给定一个排好序的数组,构造一颗平衡的二叉搜索树。我们可以每次都取数组的中间点作为当前子树的根节点,递归完成。代码如下:
/**
* Definition for a binary tree nod ...
Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The ri ...