Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我无法创建一个函数/方法来在 Java 中添加具有 4 个属性的顶点,即年龄、名称、maritalStatus 和索引,其中新顶点需要插入到指定的索引中。
有人可以指导我如何去做吗?
我如何存储这些详细信息;以邻接矩阵、邻接列表或数组列表的形式?
您使用一个类来记忆属性(例如人类类)。然后将创建的对象放入 ArrayList 中。