-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gyim1345] 그래프 구현 #20
base: master
Are you sure you want to change the base?
Conversation
add edge add vertex remove vertex remove edge has vertex has edge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깔끔하게 잘 구현하신 것 같습니다! 수고하셨슴다~~
const filteredKeys = [...this.map.get(key).filter(x=> x !== value)]; | ||
|
||
if(!filteredKeys[0]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter 대신 find를 쓰면 조금 더 명시적일 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter 하나로 퉁 칠려고 했는데 명시적으로 쓰기 위해서 find 와 filter 둘다 쓰는게 좋을까요?
const arr = this.map.get(a); | ||
if(arr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (this.map.has(a)) { ... }
요렇게 퉁쳐도 될 것 같네여!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
아 이 부분 사실 바로 밑줄에 this.map.get(a)
를 한번 더 써서 변수에 담아서 쓸려고 했는데 정작 변수에 담아 놓고 안썼네요 ㅋㅋ...
한번 더 쓰게 되면 변수에 담아서 쓰는게 좋겠죠?
구현한 메서드