How to implement a tree data-structure in Java?

前端 未结 24 2537
鱼传尺愫
鱼传尺愫 2020-11-22 00:27

Is there any standard Java library class to represent a tree in Java?

Specifically I need to represent the following:

  • The sub-tree at any node can have
24条回答
  •  [愿得一人]
    2020-11-22 01:05

    You can use the HashTree class included in Apache JMeter that is part of the Jakarta Project.

    HashTree class is included in the package org.apache.jorphan.collections. Although this package is not released outside the JMeter project, you can get it easily:

    1) Download the JMeter sources.

    2) Create a new package.

    3) Copy on it /src/jorphan/org/apache/jorphan/collections/ . All files except Data.java

    4) Copy also /src/jorphan/org/apache/jorphan/util/JOrphanUtils.java

    5) HashTree is ready to use.

提交回复
热议问题