How to implement graph in core java?

前端 未结 3 1700
醉话见心
醉话见心 2021-01-19 06:44

I\'ve a directed unweighted graph. Number of nodes and all links between nodes are given. I tried to do the task with array of vectors but java doesn\'t support it. ArrayLis

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-19 07:01

    You could use many collection data structures, in particular hash tables or sets, for your purpose. Java gives you a lot of collection generic containers (HashMap-s, ArrayList-s etc etc.). I'm not a Java expert, but searching for Java Collections give a big lot of results, e.g. this tutorial

提交回复
热议问题