pex11_4.cpp

来自「数据结构C++代码,经典代码,受益多多,希望大家多多支持」· C++ 代码 · 共 31 行

CPP
31
字号
#include <iostream.h>
#pragma hdrstop

#include "treeprnt.h"
#include "bstree.h"
#include "wex11_21.h"

void main(void)
{
    // build binary search tree with data from array a
    BinSTree<int> tree;
    int a[] = {7,3,6,5,3,7,8,7,25,3,33,4};
    
    // create tree and print it horizontally
    for(int i=0;i < 12;i++)
    	InsertOne(tree,a[i]);
    PrintTree (tree.GetRoot(), 0);
}

/*
<Run>
                  33
            25
      8
7
            6
                  5
                        4
      3
*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?