Why Java Collection Framework doesn't contain Tree and Graph

前端 未结 6 1906
太阳男子
太阳男子 2020-12-05 06:39

I am familiar with Java Collection Framework which contains basic interfaces: Collection and Map. I am wondering why the Framework doesn\'t contain

6条回答
  •  时光取名叫无心
    2020-12-05 07:10

    I am afraid the answer is: it's too troublesome to design and maintain a generic tree structure and interfaces (see answer to this post). Most users will need the performance of tree-based implementations of lists and sets, but will not be concerned with the internals, so most of them are hidden.

提交回复
热议问题