Say, to implement a directed map of G(vertex,arcs) with adjacency lists. Naturally, one would like to deleted all the edges associated with a given node when trying to delete it. Without explicit call of destructor, how to do this in Java?
【在 l*********s 的大作中提到】 : Say, to implement a directed map of G(vertex,arcs) with adjacency lists. : Naturally, one would like to deleted all the edges associated with a given : node when trying to delete it. : Without explicit call of destructor, how to do this in Java?
b*r
7 楼
re
【在 S*****n 的大作中提到】 : 本版主心情好,散尽家财发三天包子,re者有份!
s*s
8 楼
sounds no.
【在 s******l 的大作中提到】 : 有华语歌手吗
l*s
9 楼
We are asked to implement the map and associated algorithm as exercises, thus java's prepackaged data structures cannot be used. So your suggestion is to manually dereference all the edges from a vertex from the Map class, right?
【在 g*****g 的大作中提到】 : Map.remove doesn't do it for you?
l*r
10 楼
先re。
【在 b****r 的大作中提到】 : re
g*g
11 楼
No, the edges are a list for value, the vertex is the key, remove the key and it's all done. If you have to implement map, then implement one.
【在 l*********s 的大作中提到】 : We are asked to implement the map and associated algorithm as exercises, : thus java's prepackaged data structures cannot be used. So your suggestion : is to manually dereference all the edges from a vertex from the Map class, : right?
r*k
12 楼
re
【在 S*****n 的大作中提到】 : 本版主心情好,散尽家财发三天包子,re者有份!
l*s
13 楼
明白了,谢谢好虫!
【在 g*****g 的大作中提到】 : No, the edges are a list for value, the vertex is the key, remove the key : and : it's all done. If you have to implement map, then implement one.