本月博客排行
-
第1名
龙儿筝 -
第2名
lerf -
第3名
fantaxy025025 - johnsmith9th
- xiangjie88
- zysnba
年度博客排行
-
第1名
青否云后端云 -
第2名
宏天软件 -
第3名
gashero - wy_19921005
- vipbooks
- benladeng5225
- e_e
- wallimn
- javashop
- ranbuijj
- fantaxy025025
- jickcai
- gengyun12
- zw7534313
- qepwqnp
- 解宜然
- ssydxa219
- zysnba
- sam123456gz
- sichunli_030
- arpenker
- tanling8334
- gaojingsong
- kaizi1992
- xpenxpen
- 龙儿筝
- jh108020
- wiseboyloves
- ganxueyun
- xyuma
- xiangjie88
- wangchen.ily
- Jameslyy
- luxurioust
- lemonhandsome
- mengjichen
- jbosscn
- zxq_2017
- lzyfn123
- nychen2000
- forestqqqq
- wjianwei666
- ajinn
- zhanjia
- Xeden
- hanbaohong
- java-007
- 喧嚣求静
- mwhgJava
- kingwell.leng
最新文章列表
LeetCode 109 - Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
private ListNode h;
public TreeNode sortedListToBST(ListNode head) {
if(head == nu ...
LeetCode 108 - Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
public TreeNode sortedArrayToBST(int[] num) {
if(num.length==0) return null;
return toBST( ...
Find Next Node of BST
Write an algorithm to find the ‘next’ node (i.e., in-order successor) of a given node in a binary search tree. You may assume that each node has a link to its parent.
public TreeNode findNext(TreeN ...
LeetCode - 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() ...
Balanced Search Tree
1. 2-3 tree
a) Allow 1 or 2 keys per node.
1) 2-node: one key, two children.
2) 3-node: two keys, three children.
b) Perfect balance: Every path from ...
Binary Search Trees
1. Binary Search Tree:
a) Definition : A BST is a binary tree in symmetric order.
A binary tree is either:
-- Empty.
-- Two disjoint binary trees (left and right) ...
生成二叉树和红黑树的helloworld(1)
参考的这个视频
视频讲得有点烂,代码错误很多,诶,不过ptree似乎挺好,挺直观的
递归都能变成栈? 中序遍历,先序遍历,后续遍历都是栈,层序遍历用的队列
bst数的,增删
[root@VM_253_237_tlinux ~/tree]# cat bst.c
#include <stdlib.h>
#include <stdio.h>
#include &l ...
HDU 3791 二叉搜索树
二叉搜索树
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 218Accepted Submission(s): 96
Problem Description
判断两序列是否为同一 ...