-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
自製 Graph.h 和 Vertex.h
Graph 的 attributes/methods
V: vector<vertex>
int add_vertex(vertex)
int remove_vertex(name)
void get_vertices_list()
int add_vertex(vertex)
將一個 vertex 加入 graph,之後就會顯示在 graph.V 裡面,graph.get_vertices_list() 也能列出來,成功回傳 1 ,失敗回傳 0
int remove_vertex(name)
傳入 vertex 的 name 來刪除 vertex,如果成功回傳 1, 失敗回傳 0
void get_vertices_list()
將這個 graph 的所有 vertices name都列出來,中間用空白隔開,沒有就顯示 empty ,example:
3 5 6 a b c
or
empty
Vertex 的 attributes/methods
name: string
discover: int
finish: int
parent: vertex pointer
color: string
adjacency: vector<vertex>
void connect_vertex(vertex)
Metadata
Metadata
Assignees
Labels
No labels