二叉搜索树
wangfy_
这个作者很懒,什么都没留下…
展开
-
1043 Is It a Binary Search Tree (25)
Is It a Binary Search Tree (25) 二叉搜索树的定义: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with ke...原创 2018-03-31 08:34:34 · 180 阅读 · 0 评论 -
1064 Complete Binary Search Tree (30)
Complete Binary Search Tree (30) BST的定义: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with key...原创 2018-03-31 08:34:38 · 369 阅读 · 0 评论 -
1099 Build A Binary Search Tree (30)
Build A Binary Search Tree (30) BST的定义: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys...原创 2018-03-31 08:34:42 · 151 阅读 · 0 评论 -
ANOJ 1008 进击的二叉查找树 (判断两棵BST是否完全一致)
Test: 判断两棵BST是否完全一致 【Thinking】 1. 分别建两棵BST,然后把它们遍历到数组中,判断两个数组是否一致 2. 直接建两棵CBST,然后直接比较数组,省去了1法中的遍历的过程 3. 建一棵BST,判别其他序列是否与该树一致 4. 不建BST...? -------- 代码1 建一棵BST,判别其他序列是否与该树一致 -------- #include <cst...原创 2018-03-31 08:34:46 · 241 阅读 · 0 评论 -
二叉查找树
// 二叉查找树(Binary Search Tree -- BST) --------------------------------------------------------- // 查找 void search(node* root, int x) { if(root == NULL) { printf("空树"); return; } if(x == root->...原创 2018-04-24 14:39:51 · 117 阅读 · 0 评论