摘要: 二叉排序树又叫二叉查找树。遵循三个原则:1、一棵树要么为空,要么2、左孩子节点小于根节点值,根节点值小于右孩子节点值3、子树也具备这个规则代码:#include <iostream>#include <cstdlib>using namespace std;static int flag=0;typedef struct binst{ int data; struct binst *lchild; struct binst *rchild;}*BST;void createBST(BST &bst,int key){ BST t,p,pre; t=(BST)ma 阅读全文
posted @ 2013-05-17 19:20 xshang 阅读(202) 评论(0) 推荐(0) 编辑