在java中表示树层次结构

编程入门 行业动态 更新时间:2024-10-28 10:23:47
本文介绍了在java中表示树层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可能重复: Java树数据结构?

我想表示一个层次java中的结构层次结构可以是

I want to represent a hierarchical structure in java. The hierarchy can be of the form

Key | |-Value1 | |-Value11 | |-Value111 |-Value2 | |-Value22 |-Value3 |-Value4

任何人都可以建议我在java中代表这种层次结构的最好的数据结构?

Can anyone suggest me the best possible data structure to represent this kind of hierarchy in java?

推荐答案

看到这个答案:

Java树数据结构

基本上没有什么在标准库中,提供了一个开箱即用的树形表示,除了JTree在swing包中。

Basically, there is nothing in the standard libs that offers a Tree representation out of the box, except for the JTree in the swing package.

你可以自己滚动(在链接的答案),或使用那个,实际上很好。

You can either roll your own (some tips offered in the linked answer), or use that one, which works well actually.

更多推荐

在java中表示树层次结构

本文发布于:2023-10-20 03:47:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1509748.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:层次   结构   java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!