Major/Data Structure & Algorithm

    [2월 18일] Selection Sort Algorithm 삽입정렬, Insertion Sort Algorithm 삽입정렬

    [2월 18일] Selection Sort Algorithm 삽입정렬, Insertion Sort Algorithm 삽입정렬

    *참고 영상 : https://youtu.be/GUDLRan2DWM #1 Selection Sort 선택정렬 1. Scan the whole array to find the minimum 2. Instead of filling 1 in 0th index on array B, SWAP with the 0th index. Because that's where 1 belongs, it belongs to 0th index. 3. Look for the next minimum, 1 need NOT to be considered. Scan index 1 to 5th. *The array is divided into 2 parts sorted or else. And we need to do (n-2) passes...

    [2월 5일] 버블정렬 알고리즘, 문자수만큼 회전하기

    #문자수만큼 오른쪽으로 한바퀴 회전하여 출력하는 프로그램 한 글자를 임시 변수에 저장해두고 제쳐둔다음, 나머지 글자를 하나씩 밀어주기(=회전시키기) 여기서 중요한건.. tmp라는 변수에 문자를 저장하는 것임. //문자수만큼 오른쪽으로 한바퀴 회전하여 출력하는 프로그램 //길이 구하는 함수 int whatLen(char* snt) { int len = 0; for (int i = 0; snt[i] != '\0'; i++) //표현 기억해두기. len++; return len; } void move(char* snt, char tmp) { int len = whatLen(snt); for (int i = 0; i < len; i++) { /*임시변수 tmp에 가장 끝 글자 저장하고, 끝에서부터 한칸씩 밀어준..