当前位置:网站首页>js平铺数据查找叶子节点
js平铺数据查找叶子节点
2022-07-04 14:00:00 【spring-java】
直接上代码
function chooseLeafNode(id,parentId,list=[]){
let treeData=[]
for(let i=0;i<list.length;i++){
let isLeavel=true
for(let j=0;j<list.length;j++){
if(list[i][id]==list[j][id]){
continue
}
if(list[i][id]==list[j][parentId]){
isLeavel=false
break
}
}
if(isLeavel){
treeData.push(list[i])
}
}
return treeData
}
边栏推荐
- [learning notes] matroid
- Helix Swarm中文包发布,Perforce进一步提升中国用户体验
- Helix swarm Chinese package is released, and perforce further improves the user experience in China
- Graduation season - personal summary
- Korean AI team plagiarizes shock academia! One tutor with 51 students, or plagiarism recidivist
- 炒股网上开户安全吗?会不会被骗。
- 内存管理总结
- Width and alignment
- 宽度与对齐
- 进制形式
猜你喜欢
Redis 解决事务冲突之乐观锁和悲观锁
Halcon knowledge: NCC_ Model template matching
Leetcode 1200 minimum absolute difference [sort] the way of leetcode in heroding
对话龙智高级咨询顾问、Atlassian认证专家叶燕秀:Atlassian产品进入后Server时代,中国用户应当何去何从?
I plan to teach myself some programming and want to work as a part-time programmer. I want to ask which programmer has a simple part-time platform list and doesn't investigate the degree of the receiv
Techsmith Camtasia Studio 2022.0.2屏幕录制软件
SAIC Maxus officially released its new brand "mifa", and its flagship product mifa 9 was officially unveiled!
TechSmith Camtasia studio 2022.0.2 screen recording software
暑期复习,一定要避免踩这些坑!
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
随机推荐
Comment configurer un accord
Five minutes of machine learning every day: why do we need to normalize the characteristics of numerical types?
自动控制原理快速入门+理解
Helix swarm Chinese package is released, and perforce further improves the user experience in China
Details of FPGA underlying resources
UFO: Microsoft scholars have proposed a unified transformer for visual language representation learning to achieve SOTA performance on multiple multimodal tasks
go-zero微服务实战系列(九、极致优化秒杀性能)
MP3是如何诞生的?
Exploration and practice of eventbridge in the field of SaaS enterprise integration
Openresty redirection
IO flow: node flow and processing flow are summarized in detail.
The performance of major mainstream programming languages is PK, and the results are unexpected
Korean AI team plagiarizes shock academia! One tutor with 51 students, or plagiarism recidivist
5G电视难成竞争优势,视频资源成中国广电最后武器
Introduction to asynchronous task capability of function calculation - task trigger de duplication
Cann operator: using iterators to efficiently realize tensor data cutting and blocking processing
LVGL 8.2 Line
C language personal address book management system
When synchronized encounters this thing, there is a big hole, pay attention!
Luo Gu - some interesting questions