BST
Eighteen__
这个作者很懒,什么都没留下…
展开
-
1115 Counting Nodes in a BST(甲级)
1115 Counting Nodes in a BST (30分) 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 less than or equal to the node’s key. The right subtree of a原创 2020-11-21 12:18:21 · 93 阅读 · 0 评论 -
二叉搜索树基本操作(增删查改)
#include<iostream> using namespace std; typedef struct Tree { int data; struct Tree* l; struct Tree* r; }*BTree; void insert(BTree root, int data) { BTree p, s, tmp=root; p = root; while (p) { tmp = p; if (data < p->data) { p =原创 2020-10-26 15:59:23 · 257 阅读 · 0 评论