/*package ch.util;

import com.trm.model.func.FunctionTree;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set; public class FunctionUtil {
public static List<FunctionTree> createTreeMenus(List<FunctionTree> trees) {
List<FunctionTree> treeMenus = null;
if (null != trees && !trees.isEmpty()) {
// 创建根节点
FunctionTree root = new FunctionTree(); // 组装Map数据
Map<String, FunctionTree> dataMap = new HashMap<String, FunctionTree>();
for (FunctionTree tree : trees) {
dataMap.put(tree.getServiceCode(), tree);
} // 组装树形结构
Set<Map.Entry<String, FunctionTree>> entrySet = dataMap.entrySet();
for (Map.Entry<String, FunctionTree> entry : entrySet) {
FunctionTree tree = entry.getValue();
if (null == tree.getParentFlag() || "0".equals(tree.getParentFlag())) {
root.getChildren().add(tree);
} else {
dataMap.get(tree.getParentFlag()).getChildren().add(tree);
}
}
root.sortChildren();
treeMenus = root.getChildren();
}
return treeMenus;
}
}
*/

tree 树状构建的更多相关文章

  1. HDU3333 Turing Tree 树状数组+离线处理

    Turing Tree Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  2. POJ 3321 Apple Tree(树状数组)

                                                              Apple Tree Time Limit: 2000MS   Memory Lim ...

  3. HDU 3333 - Turing Tree (树状数组+离线处理+哈希+贪心)

    题意:给一个数组,每次查询输出区间内不重复数字的和. 这是3xian教主的题. 用前缀和的思想可以轻易求得区间的和,但是对于重复数字这点很难处理.在线很难下手,考虑离线处理. 将所有查询区间从右端点由 ...

  4. POJ--3321 Apple Tree(树状数组+dfs(序列))

    Apple Tree Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 22613 Accepted: 6875 Descripti ...

  5. gym 100589A queries on the Tree 树状数组 + 分块

    题目传送门 题目大意: 给定一颗根节点为1的树,有两种操作,第一种操作是将与根节点距离为L的节点权值全部加上val,第二个操作是查询以x为根节点的子树的权重. 思路: 思考后发现,以dfs序建立树状数 ...

  6. poj2486--Apple Tree(树状dp)

    Apple Tree Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7789   Accepted: 2606 Descri ...

  7. tree ---树状显示

    tree命令以树状图列出目录的内容. 语法 tree(选项)(参数) 选项 -a:显示所有文件和目录: -A:使用ASNI绘图字符显示树状图而非以ASCII字符组合: -C:在文件和目录清单加上色彩, ...

  8. POJ 3321:Apple Tree 树状数组

    Apple Tree Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 22131   Accepted: 6715 Descr ...

  9. E - Apple Tree(树状数组+DFS序)

    There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. ...

随机推荐

  1. 「网络流24题」「Codevs1237」 餐巾计划问题

    1237 餐巾计划问题 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 钻石 Diamond   题目描述 Description 一个餐厅在相继的 N 天里,每天需用的餐巾数不尽相 ...

  2. Watir: Watir webdriver对JS 弹出框的操作现在非常简单。

    以下代码支持Firefox,IE,Chrome require 'watir-webdriver' #require "watir-webdriver/extensions/alerts&q ...

  3. 你真的懂redis吗?

    Redis在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在Redis的使用和原理方面对小伙伴们进行各种刁难.作为一名在互联网技术行业打击过成百上千名[请允许我夸张一下]的资深技术面试官 ...

  4. MongoDB 用户名密码登录

    Mongodb enable authentication MongoDB 默认直接连接,无须身份验证,如果当前机器可以公网访问,且不注意Mongodb 端口(默认 27017)的开放状态,那么Mon ...

  5. kubeadm安装Kubernetes13.1集群-三

    环境: master: 192.168.3.100 node01: 192.168.3.101 node02: 192.168.3.102 关闭所有主机防火墙,selinux: 配置主机互信: mas ...

  6. Nginx: 统计PV、UV、独立IP

    1.概念: UV(Unique Visitor):独立访客,将每个独立上网电脑(以cookie为依据)视为一位访客,一天之内(00:00-24:00),访问您网站的访客数量.一天之内相同cookie的 ...

  7. DB Link 去除域名

    1.查看global_name的设置 SQL> show parameters global_name; NAME                                 TYPE    ...

  8. springcloud(二) 负载均衡器 ribbon

    代码地址:https://github.com/showkawa/springBoot_2017/tree/master/spb-demo ribbon是一个负载均衡客户端 类似nginx反向代理,可 ...

  9. 黑客攻防技术宝典web实战篇:攻击验证机制习题

    猫宁!!! 参考链接:http://www.ituring.com.cn/book/885 随书答案. 1. 在测试一个使用joe和pass证书登录的Web应用程序的过程中,在登录阶段,在拦截代理服务 ...

  10. Codeforces Round #513解题报告(A~E)By cellur925

    我是比赛地址 A:Phone Numbers $Description$:给你一串数字,问你能组成多少开头为8的11位电话号码. $Sol$:统计8的数量,与$n$%11作比较. #include&l ...