My Source Depot
Sunday, October 20, 2013
그래프 자료구조
그래프를 표현하는 방법
1. 인점리스트 ( adjacency list)
- 각 정점마다 해당 점점에서 나가는 간선의 목록을 저장함
ex> vector<list<int> > adjacent;
2. 인접 행렬 표현 ( adjacency matrix)
- 인접리스트는 각각을 trace해야하므로 시간이 걸린다. 속도를 높이기위해서 행렬을 이용할수있다.
ex> vector<vector<bool> > adjacent;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment