登录
首页 » c++ » 搜索二叉树

搜索二叉树

于 2022-02-28 发布 文件大小:447.11 kB
0 135
下载积分: 2 下载次数: 1

代码说明:

#pragma once template struct Node { T _data; Node* left; Node* right; Node(T val) :_data(val), left(NULL), right(NULL) {} ~Node() {} }; template class BinSearchTree { public: BinSearchTree() :_root(0) {} void CreatTree(char* str) { int n = strlen(str); CreatTree_(_root,str,n); } void comFather(char a,char b) { return comFather_(_root,a,b); } protected: void comFather_(Node* root,char a,char b) { if (root->_data > a && root->_data < b) { cout _data _data > a && root->_data > b) comFather_(root->left, a, b); if (root->_data < a && root->_data < b) comFather_(root->right, a, b); } void insertVal(Node*& root, char ch) { if (root == NULL) { root = new Node(ch); return;

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • FillRegion
    说明:  VC++填充区域图像小实例,将规定区域填充成其它颜色,与图像处理紧密相关,有需要的编译一下。(VC++ fills the regional image of small examples, will provide area filling into other colors, and image processing is closely related to the need to build what.)
    2010-03-31 21:49:15下载
    积分:1
  • 用于MICROCHIP 24LC64 EEPROM的读写E2PROM_DSP
    说明: 本程序用于MICROCHIP 24LC64 EEPROM的读写。本程序不使用芯片级联方式, 请将A0,A1,A2 管脚接至低电平。本程序使用IOC6作为SDA,IOC7作为SCL。 程序中的地址空间最大可至64K:24LC00-16-0,24LC01-128-8,24LC02-256-8, 24LC04-512-16,24LC08-1K-16,24LC16-2K-32,24LC32-4K-32,24LC64-8K-32, 24LC128-16K-64,24LC256-32K-64,24LC512-64K-128,读写数据均为8bits。 以上器件的格式为(型号-地址空间-页大小)不同器件的页大小不同,因此页写 程序需作相应修改,其他字节写,随机读以及顺序读程序均相同 (This procedure for the MICROCHIP 24LC64 EEPROM read and write. This procedure does not use chips cascade way, please A0, A1, A2 pin to low level access. This procedure used IOC6 as SDA, IOC7 as SCL. Process address space available to the largest 64K: 24LC00-16-0, 24LC01-128-8, 24LC02-256-8, 24LC04-512-16, 24LC08-1K-16, 24LC16-2K-32, 24LC32-4K- 32,24 LC64-8K-32, 24LC128-16K-64, 24LC256-32K-64, 24LC512-64K-128, read and write data are 8bits. The format for the above device (Model- address space- page size) of different devices of different sizes of pages, so page written procedures need to be amended accordingly, and other bytes to write, random read and sequential read are the same procedures)
    2021-04-27 19:38:44下载
    积分:1
  • Programming-Optimization
    Programming Optimization: by Paul Hsieh
    2012-10-25 20:57:48下载
    积分:1
  • vp树
    #ifndef _VPTREE_HEADER_ #define _VPTREE_HEADER_ #include #include #include #include #include #include template class VpTree { public:     VpTree() : _root(0) {}     ~VpTree() {         delete _root;     }     void create( const std::vector& items ) {         delete _root;         _items = items;         _root = buildFromPoints(0, items.size());     }     void search( const T& target, int k, std::vector* results, std::vector* distances) 
    2023-06-23 00:20:03下载
    积分:1
  • 1
    说明:  DOS命令下的串口文件传输程序 基于API函数(DOS command under the serial file transfer program is based on API functions)
    2010-08-07 19:19:37下载
    积分:1
  • Eros
    用c语言编写的俄罗斯方块游戏源码,控制台下的模拟(Tetris source code written in c language, simulation of the console )
    2013-05-02 20:00:56下载
    积分:1
  • PCI_DMC_A01-multi_axes
    PCI_DMC_A01台达12轴运动控制卡C#.Net程序源码案例-圆弧及直线插补(PCI_DMC_A01 delta 12 axis motion control card C#.Net source case- circular and linear interpolation)
    2015-08-16 08:30:28下载
    积分:1
  • 书籍
    说明:  包含导弹飞行力学书籍及ppt,导弹制导与控制原理书籍,以及有翼导弹飞行动力学(Includes books on missile flight mechanics and ppt, books on missile guidance and control, and flight dynamics of winged missiles)
    2021-03-23 16:39:15下载
    积分:1
  • Droplet
    液滴在壁面上流动的程序 可以用 tecplot画图 效果很好(The flow of the liquid drop on the wall of the program can be used to draw the effect of Tecplot is very good)
    2015-09-15 09:09:08下载
    积分:1
  • j-link-The-firmware-fix-pack
    J-LINK V8 出厂固件烧录与修复文件,压缩包中的.bin烧录文件为破解文件烧录即可使用,且附带烧录教程、破解教程(J- LINK V8 factory firmware replication and repair files, compressed package. In the buffer bin file for solving file replication can be used, and the supplementary burning tutorials, crack tutorial)
    2016-02-17 17:43:38下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载