tree<std::string> tr9;
tree<std::string>::pre_order_iterator iter1;
tr9.set_head("hi");
tr9.insert_after(tr9.begin(), "a");
tr9.insert_after(tr9.begin(), "b");
tr9.append_child(tr9.begin(), "0");
tr9.append_child(tr9.begin().begin(), "0.1");
tr9.append_child(tr9.begin().begin(), "0.0");

iter1 = tr9.begin();
int num1 = iter1.number_of_children();
if (num1 > 0) {
iter1 = tr9.child(iter1, num1 - 1);
if (iter1 == NULL)
XTRACE_RAW(COLOR_BLACK, "null iter?\n");
else
tr9.insert_after(iter1, "2");
} else {
tr9.append_child(tr9.begin(), "1");
}
print_tree(tr9, tr9.begin(), tr9.end());
int depth1 = tr9.depth(tr9.begin());
int depth2 = tr9.depth(tr9.begin().begin());
int size1 = tr9.size();
int size2 = tr9.size(tr9.begin());

tree<std::string> tr;
tree<std::string>::pre_order_iterator html, body, h1, h3, bh1, mv1;

print_tree(tr, tr.begin(), tr.end());

html=tr.insert(tr.begin(), "html");
tr.insert_after(html, "extra");
body=tr.append_child(html, "body");
h1 =tr.append_child(body, "h1");
bh1 = tr.insert_after(h1, "after h1");
auto aa = tr.parent(bh1);
tr.append_child(aa, "some textaaa");
tr.append_child(h1, "some text");
tr.append_child(body, "more text");

print_tree(tr, tr.begin(), tr.end());

XTRACE_RAW(COLOR_BLACK, L"test finish\n");

url: http://tree.phi-sci.com/

一个不错的多叉树, stl风格的更多相关文章

  1. 一个不错的loading效果--IT蓝豹

    一个不错的loading效果 介绍:一个不错的loading加载效果,弹性收缩,效果不错,学习android动画的朋友可以下载来研究研究本例子其实由SeekBar实现,由MetaballView,Me ...

  2. datetimepicker一个不错的日历android特效

    datetimepicker一个不错的日历效,选中和选择日历效果都很不错, 实用的时候直接可以把datetimepicker-library这个引入到项目,调用的地方在实现 TimePickerDia ...

  3. 一个不错的shell 脚本教程 入门级

    一个很不错的bash脚本编写教程,至少没接触过BASH的也能看懂     建立一个脚本 Linux中有好多中不同的shell,但是通常我们使用bash (bourne again shell) 进行s ...

  4. 【转】一个不错的eclipse反编译插件

    [转]一个不错的eclipse反编译插件 在CSDN论坛上看到的一个不错的eclipse反编译插件,感觉看起来不错的样子,因而记下,原网址是:http://topic.csdn.net/u/20121 ...

  5. 一个不错的图片滑动展示插件 anythingslider

    一个不错的图片http://css-tricks.com/anythingslider-jquery-plugin/ DEMO演示: http://css-tricks.github.io/Anyth ...

  6. linux中内核的一个不错的参数somaxconn

    导读:在linux中,/proc/sys/net/core/somaxconn这个参数,linux中内核的一个不错的参数somaxconn 看下其解析: 对于一个TCP连接,Server与Client ...

  7. 一个不错的PPT,扁平化设计,开放资源,要的进来

    开了那么多的博客,没做啥资源贡献,今天共享一个不错的PPT模板.例如以下图所看到的,须要的话留下邮箱 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbGFp ...

  8. [置顶] ios 一个不错的图片浏览分享框架demo

    demo功能:一个不错的图片浏览分享框架demo.iphone6.1 测试通过.可以浏览图片,保存,微博分享到新浪,腾讯,网易,人人等. 注:(由于各个微博的接口有时候会有调整,不一定能分享成功.只看 ...

  9. 分享一个不错的Unittest测试报告

    分享一个不错的,unittest测试报告. 先上图: 代码如下: 复制下来保存成py可用 #coding=utf-8 """ A TestRunner for use w ...

随机推荐

  1. thinkphp中上传图片以及制成缩略图

    form表单中必须有的一个属性: enctype=”multipart/form-data” html的写法: <form action="__SELF__" method= ...

  2. 转发: 关于ST MCU的UID详细说明

    https://www.stmcu.org.cn/article/id-327990 ST MCU芯片中的绝大部分都内置一串96位唯一标识码[unique ID].时不时有人问起这个东西,尤其最近感, ...

  3. leetcode每日刷题计划-简单篇day12

    Num 125 验证回文串 Valid Palindrome 非常有收货的一道题嘻嘻嘻,本来是考试期间划水挑的题,坑点有点多 第一个是注意对temp1和temp2中途更新的判断 第二个是字符串频繁的作 ...

  4. wdk1703+vs2015编译的诡异问题

    最近将wdk升级到1703(10.0.15063.0)版本,编译一个新建的minifiter项目居然出现了失败 提示错误为 WindowsDriver.common.targets(460,5): e ...

  5. java面试题复习(八)

    71.如何通过反射创建对象? 方法1:通过类对象调用newInstance()方法,例如:String.class.newInstance()  方法2:通过类对象的getConstructor()或 ...

  6. leetcode1035

    class Solution: def maxUncrossedLines(self, A: 'List[int]', B: 'List[int]') -> int: m = len(A) n ...

  7. groovy 知识集锦

    对应官方的<Program structure>的中文翻译 http://www.cnblogs.com/zhaoxia0815/p/7404387.html

  8. Spark-shell错误:Missing Python executable 'python', defaulting to ...

    最近博主因为学习<云计算导论>一课,需要在Windows上搭建Saprk,故在网上找了相关教程搭建,步骤如下: 1. Scala 2.Spark 3.Handoop 但是不管博主怎么修正, ...

  9. thymeleaf标签必须由匹配的结束标记终止

    问题描述 springboot使用Thymeleaf标签时会报元素类型必须由匹配的结果标记终止. 如下所示 如果我们一个个的给这些元素后面加上终止标记也是件很麻烦的事~~~~ 解决办法 方法一: 在p ...

  10. c#电子印章制作管理系统

    产品名称:电子印章制作管理系统 版  本  号:v0.0.0.1产品说明:本产品采用位图绘制方式,主要针对OA.ERP.金融等行业取代实物印章的一款产品,本产品有以下特点1.制作方便,容易操作2.规格 ...