Try
출처https://programmers.co.kr/learn/courses/30/lessons/12901 소스 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include #include #include using namespace std; string solution(int a, int b) { string answer = ""; string day[] = {"THU","FRI","SAT","SUN","MON","TUE","WED"}; if(a==1) {} else if(a==2) { b = b+31; } else if(a==3) { b = b..
출처https://programmers.co.kr/learn/courses/30/lessons/42576 소스 123456789101112131415161718192021222324#include #include #include #include using namespace std; string solution(vector par, vector com) { string answer = ""; sort(par.begin(), par.end()); sort(com.begin(), com.end()); for(int i = 0; i
출처https://programmers.co.kr/learn/courses/30/lessons/12899 소스 1234567891011121314151617181920212223242526272829#include #include using namespace std; string solution(int n) { string arr[3] = {"4","1","2"}; string answer = ""; int index; while(n>0) { index = n % 3; if(index == 0) { n = n-1; } n = n / 3; answer = arr[index] + answer; } return answer;}Colored by Color Scriptercs
셸 정렬(Shell sort) 셸 정렬(영어: shell sort)은 가장 오래된 정렬 알고리즘의 하나이다. 이름은 1959년 이 방법을 발표한 창안자 도널드 셸의 이름을 따서 붙여졌다. 셸 정렬은 개념을 이해하고 구현하기는 쉬우나 시간복잡도 분석은 조금 복잡하다. 셸 정렬은 다음과 같은 삽입 정렬의 성질을 이용, 보완한 삽입정렬의 일반화로 볼 수 있다. 삽입 정렬은 입력되는 초기리스트가 "거의 정렬"되어 있을 경우 효율적이다.삽입 정렬은 한 번에 한 요소의 위치만 결정되기 때문에 비효율적이다.셸 정렬은 주어진 자료 리스트를 특정 매개변수 값의 길이를 갖는 부파일(subfile)로 쪼개서, 각 부파일에서 정렬을 수행한다. 즉, 매개변수 값에 따라 부파일(Subfile)이 발생하며, 매개변수값을 줄이며 이..
분할 합병 정렬(Merge Sort) 합병 정렬 또는 병합 정렬(merge sort)은 O(n log n) 비교 기반 정렬 알고리즘이다. 일반적인 방법으로 구현했을 때 이 정렬은 안정 정렬에 속하며, 분할 정복 알고리즘의 하나이다. 존 폰 노이만이 1945년에 개발했다. 소스 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687/*/* /* khsh5592@naver.com/* has3ong.tistory.com/* /* 2018 - 11 - 16/**/ #incl..