강의

멘토링

커뮤니티

Inflearn Community Q&A

vkdvkd35463397's profile image
vkdvkd35463397

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

10. Finding combinations (DFS)

질문드립니다.

Written on

·

229

0

코드에서

  1. 그냥 순열에서는 else가 들어가지 않았는데 def DFS 안에 else 구문이 왜 들어가는 것인지 궁금합니다.

    제가생각한 답: 순열과 다르게 중복되면 안되기때문에\

     

  2. def DFS 안의 DFS호출 부분에서 두 번째 인자에 왜 S+1이 들어가면 안되는지 궁금합니다.

    제가 생각한 답: 모르겠습니다.

python코테 준비 같이 해요!

Answer 1

1

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

  1. 순열도 else 가 있습니다.

  2. 두번째 인자를 s+1 로 넘기면 아래 그림처럼 DFS가 작동합니다.

    image

vkdvkd35463397's profile image
vkdvkd35463397

asked

Ask a question