빈스토리

  • 홈
  • 태그
  • 방명록

조합 1

[알고리즘/Algorithm]순열(Permutation)/조합(Combination)/부분집합(Power Set)

순열(Permutation) 서로 다른 것들 중 몇 개를 뽑아서 한줄로 나열하는 것 (nPr = n!) n>12인 경우, 시간 복잡도 폭발적으로 상승 void permutation(int cnt) { if (cnt == r) { // 순열 생성 완료 return; } for (i 1 to n) { if (isSelected[i]) continue; numbers[cnt] += i; isSelected[i] = true; permutation(cnt + 1); isSelected[i] = false; } } 조합(Combination) 서로 다른 n개의 원소 중 r개를 순서 없이 골라낸 것 void combination(int cnt int index) { if(cnt == r) { // 조합 생성 완료 ..

Develop/Algorithm 2021.02.07
이전
1
다음
더보기
프로필사진

빈스토리

https://github.com/happ-in

  • 분류 전체보기 (56)
    • Diary (25)
      • 일기 (11)
      • SSAFY (12)
    • Develop (28)
      • Algorithm (3)
      • AWS (5)
      • Block Chain (1)
      • DevOps (1)
      • Git (8)
      • Java (3)
      • Spring (6)
      • etc (1)
    • CS (0)
      • 네트워크 (0)

Calendar

«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :
Github

Copyright © Kakao Corp. All rights reserved.

티스토리툴바