[지하철 노선도 경로 조회 미션] 임선빈 미션 제출합니다. #36
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
안녕하세요. 우아한테크코스 3기 프론트엔드 과정 지원자 임선빈입니다.
지하철 노선도 경로 조회 미션 제출합니다.
이번 미션을 시작하기 전 가장 고민했던 부분은 최단거리 / 최소시간을 구하는 라이브러리가 제공되었지만 이것을 어떻게 활용해야 할지였습니다.
처음에는 거리와 시간 두 가지 가중치가 있기 때문에 사용자의 선택에 따라 시작역과 종착역 사이의 구간을 모두 구해 addEdge를 해주어야겠다고 생각하였습니다. 이 부분에 대해 세 가지 방법을 생각하였습니다.
1번의 경우 직접 타이핑으로 입력해 두어야하는 번거러움이 있었고, 만약 노선이 추가된다면 매번 타이핑을 해주어야 하는 단점이 있다고 생각하였습니다.
3번의 경우 로직을 생각하기 어려웠고, 검색할 때 마다 탐색을 하는 복잡한 과정이 필요하다고 생각하였습니다.
그래서 2차원 그래프를 미리 만들기로 하였습니다.
라이브러리의 구조를 파악해보다 시간과 거리에 대해 각각 객체로 만들어 둔다면 그래프 기능을 직접 구현하지 않아도 된다고 생각하였고, 라이브러리를 활용하여 그래프를 만들어 미션을 수행하였습니다.
마지막 미션도 정말 어려웠습니다. 그래도 함께 지원한 모든 분들과 우아한 테크코스 모두 수고하셨습니다. 😊