-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DFS_BFS] 4월 9일 #8
base: main
Are you sure you want to change the base?
Conversation
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.
2606(P3), 2644(P3)
안녕하세요 지운님! 코드 리뷰 완료되었습니다👍
bfs를 이용한 문제 풀이 너무 좋았습니다.
주석이 달려있으면 더더욱 좋을 것 같습니다!
늘 성실하게 과제 제출해주셔서 감사합니다.
이번주도 고생하셨습니다! 시험 기간 화이팅입니다~!
몇 가지 사소한 코멘트 남겼습니다.
궁금하신 점이 있다면 리뷰어를 호출해주세요!
void bfs(int index) { | ||
queue<int>q; | ||
q.push(index); | ||
visited_bfs[index] = true; | ||
|
||
while (!q.empty()) { | ||
int current_v = q.front(); | ||
q.pop(); | ||
|
||
for (int i = 1; i <= n; i++) { | ||
if (li[current_v][i] == 1 && !visited_bfs[i]) { | ||
visited_bfs[i] = true; | ||
q.push(i); | ||
} | ||
} | ||
} | ||
} |
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.
P3: bfs를 이용하여 문제 풀이 잘해주셨네요!
주석이 있다면 더더욱 좋을 것 같습니다ㅎㅎ
} | ||
} | ||
|
||
cout << cnt - 1; |
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.
P3: 입출력 모두 메인에서 관리하는 것 너무 좋습니다 👍
void bfs(int index,int n) { | ||
queue<int>q; | ||
q.push(index); | ||
|
||
while (!q.empty()) { | ||
int current_v = q.front(); | ||
q.pop(); | ||
|
||
for (int i = 1; i <= n; i++) { | ||
if (li[current_v][i] != 0 && visited_bfs[i] == 0) { | ||
visited_bfs[i] = visited_bfs[current_v] + 1; | ||
q.push(i); | ||
} | ||
} | ||
} | ||
} |
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.
P3: 두 문제 모두 bfs를 이용하여 문제 풀이 잘 해주셨네요~! 최고입니다
ios::sync_with_stdio(false); | ||
cin.tie(NULL); cout.tie(NULL); |
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.
P3: 입출력 시간 관리 너무 좋습니다 👍
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.
[DFS/BFS 구현 코드 리뷰 완료]
2615
안녕하세요 지운님!
추가제출 확인 완료되었습니다👍 수고하셨습니다!
인적사항
학번: 2276209
이름: 윤지운
과제제출
기존 제출: 2606, 2644
추가 제출: 2615