摘要: 恩推倒重写.线段树就是一棵二叉树,保存区间的左右值,查询时合并结果.这样可以吧线性复杂度转化为$O(\log{n})$时间复杂度.线段树的构造很简单.struct node{ int left,right,data; struct sign{ int type; } sign;} nodes[20... 阅读全文
posted @ 2014-10-23 22:54 zball 阅读(194) 评论(0) 推荐(0) 编辑