본문 바로가기

알고리즘(C언어)40

(7)[Chapter12]분할정복_3_피보나치 수열(작성중) ##꽤 어려워 했던 부분 노트 사진 : ##핵심 개념(작성중):##코드 :  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485#include stdio.h>#include stdlib.h>#pragma warning (disable : 4996) typedef unsigned long ULONG; typedef struct _tagMatrix2x2 {    ULONG Data[2][2];}Matrix2x2; Matrix2x2 Matrix2x2_M(Matrix2x2 A,.. 2024. 9. 7.
(6)[Chapter12]분할정복_2_거듭제곱 ##이론 노트 :##코드 : 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include stdio.h>#include stdlib.h>#pragma warning (disable: 4996) typedef unsigned long ULONG; //Base : 밑 , Exponent : 지수ULONG Power(int Base, int Exponent) {    //1_ 종료조건 (지수가 0 , 1 일 때,)    if (Exponent == 0) {        return 1;    }    else if (Exponent == 1) {        return Base;    }     /.. 2024. 9. 6.
(5)[Chapter12]분할정복_1_병합정렬(이론_노트) ##이론 노트 PDF파일 :##이론 노트 사진:    ## 퀵소트와 머지소트의 공통점과 차이점 :공통점 : 분할 정복을 알고리즘을 이용한다.(구간을 나누고, 재귀호출 이용)차이점 :- 퀵소트 : 분할할 때, 구간을 나누는 기준이 PIVOT값이다.- 머지소트 : 분할할 때, 구간을 나누는 기준이 절반(MID)이다. ##코드 내용 : 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103#include st.. 2024. 9. 6.
(5)실습5주차_합병정렬과 퀵정렬 [문제1]_합병정렬(오름차순)##코드 :1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192#include stdio.h>#include stdlib.h>#pragma warning (disable : 4996) void Merge(int* A, int start, int mid , int end) {    int L = start;    int R = mid + 1;     int* B = (int*)malloc(sizeof(int) * (end.. 2024. 9. 5.