์ด์งํ์ํธ๋ฆฌ : ๋ด๋ถ๋ ธ๋์ (ํค,์์) ์์ ์ ์ฅํ๋ฉฐ, key(u)rchild == NULL) return 1; else return 0; } int isInternal(node* w) { if (w->lchild != NULL || w->rchild != NULL) return 1; else return 0; } void getNode(node** w) { (*w) = (node*)malloc(sizeof(node)); (*w)->parent = NULL; (*w)->lchild = NULL; (*w)->rchild = NULL; } void expandExternal(node* w) {//์์ชฝ ์ธ๋ถ๋ ธ๋๋ก ํ์ฅ node* newleft; node* newright; getNode(&newleft); g..
๋ฌธ์ 1: ์ ๋ ฌ๋์ด ์๋ n๊ฐ์ ์ ์ ํค(์ฌ์ )์ ํ์ํ ํค k1, k2๋ฅผ ์ ๋ ฅ๋ฐ์, ์ฌ์ ์์ k1 ≤ k ≤ k2 ๋ฅผ ๋ง์กฑํ๋ ์์น๋ค์ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑ - ์ฌ๊ท ๋ฒ์ ๊ตฌํ ์ ๋ ฅ ์์ 1 8 –7 15 โฆ n=8, k1=–7, k2=15 -92 -31 -7 4 14 20 29 44 ์ถ๋ ฅ ์์ 1 โก2 3 4 โฆ ์ฌ์ ์์ -7์ ์์น๋ 2, 15๋ณด๋ค ์์ผ๋ฉด์ ๊ฐ์ฅ ํฐ ์์น๋ 4 ์ ๋ ฅ ์์ 2 8 33 40 โฆ n=8, k1=33, k2=40 -92 -31 -7 4 14 20 29 44 ์ถ๋ ฅ ์์ 2 โก-1 โฆ ๋ฌธ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ์ฌ์ ์ ํค ์์ #include #include int t1 = 0; int t2 = NULL; int rFE(int k, int left, int right, int ..
์ด์งํ์ - ์ฌ๊ท ๋ฒ์ - x ≤ k ๋ฅผ ๋ง์กฑํ๋ ์ฌ์ ์ ํค x ์ค ๊ฐ์ฅ ํฐ ๊ฐ์ ์์น(์ฆ, ์ธ๋ฑ์ค) ์ถ๋ ฅ (์์น๋ 0๋ถํฐ ์์ํ๋ค๊ณ ๊ฐ์ ํ๊ณ , ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ x๊ฐ ์๋ ๊ฒฝ์ฐ –1 ์ถ๋ ฅ) - ์ฆ, ํค k๊ฐ ์กด์ฌํ๋ ๊ฒฝ์ฐ์๋ k์ ์์น๋ฅผ ์ถ๋ ฅํ๋ฉด ๋๊ณ , ๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ k๋ณด๋ค ์์ผ๋ฉด์ ๊ฐ์ฅ ํฐ ์์ ์์น๋ฅผ ์ถ๋ ฅํ๋ฉด ๋๋ค. ์ ๋ ฅ ์์ 1 8 -7 โฆ n = 8, k = –7 ์ถ๋ ฅ ์์ 1 -92 -31 -7 4 14 20 29 44 โก2 โฆ ์ฌ์ ์์ -7์ ์์น๋ 2 ์ ๋ ฅ ์์ 2 8 33 โฆ n = 8, k = 33 ์ถ๋ ฅ ์์ 2 -92 -31 -7 4 14 20 29 44 โก6 โฆ ๋ฌธ์ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ์ฌ์ ์ ํค๋ 29์ด๊ณ , ์ฌ์ ์์ 29์ ์์น๋ 6 #include #include int n;/..
- - - #include #include #include int findPivot(int* x, int l, int r) { if (r - l = right) break; tmp = x[left]; x[left] = x[right]; x[right] = tmp; } tmp = x[left - 1]; x[left - 1] = x[l]; x[l] = tmp; return right; } void inPlaceQuickSort(int *x, int l, int r) { int k, a, b; int t; if (l >= r) return; k = findPivot(x, l, r); t = b = inPlacePartition(x, l, r, k); while (1) { if (x[t] != x[b]) { a..
๋ถํ ํต์น๋ฒ 1. ๋ถํ 2. ์ฌ๊ท 3. ํต์น ํฉ๋ณ์ ๋ ฌ: ๋ถํ ํต์น๋ฒ์ ๊ธฐ์ดํ ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ - ํ ์ ๋ ฌ๊ณผ ๋ฌ๋ฆฌ ์ฐ์ ์์ ํ ์ฌ์ฉํ์ง X - ๋ฐ์ดํฐ๋ฅผ ์์ฐจ์ ๋ฐฉ์์ผ๋ก ์ ๊ทผ ๋จ์ผ์ฐ๊ฒฐ๋ฆฌ์คํธ๋ฅผ ์ด์ฉํ ํฉ๋ณ์ ๋ ฌ ๊ตฌํ(์ค๋ณต ์ ๋ ฅ O) ์ ๋ ฅ ์์ 1 3 โฆ n 4 9 1 ์ถ๋ ฅ ์์ 1 โก1 4 9 โฆ ์ ๋ ฌ ๊ฒฐ๊ณผ ์ ๋ ฅ ์์ 2 8 โฆ n 73 65 48 31 29 20 8 3 ์ถ๋ ฅ ์์ 2 โก3 8 20 29 31 48 65 73 โฆ ์ ๋ ฌ ๊ฒฐ๊ณผ #define _CRT_SECURE_NO_WARNINGS #include #include //ํฉ๋ณ์ ๋ ฌ typedef struct ListNode { int elem; struct ListNode* next; }node; void addList(node** L, int elem) {..
[์ ์๋ฆฌ ํ ์ ๋ ฌ] - ํ ์์ฑ ๋ฐฉ์์ ์ฝ์ ์, ์ํฅ์ ์ค ์๋ฌด๊ฑฐ๋ ์ฌ์ฉ - ์์ฐจํ์ ํตํด ๊ตฌํํ๋ค๋ฉด ์ถ๊ฐ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ์ ์๋ฆฌ ํ ์ ๋ ฌ์ด ๊ฐ๋ฅํจ - ์ ์ผํค - ์ค๋ณตํค - ์ค๋ณต ํค๋ฅผ ์ฒ๋ฆฌํ ์ ์๋๋ก ์์ฑ๋ ์๊ณ ๋ฆฌ์ฆ์ ์ ์ผ ํค ํ๊ฒฝ์์๋ ์ ํํ ์๋ํ๋ค. ํ์ง๋ง ์ ์ผ ํค๋ฅผ ์ฒ๋ฆฌํ ์ ์๋๋ก ์์ฑ๋ ์๊ณ ๋ฆฌ์ฆ์ ์ค๋ณต ํค ํ๊ฒฝ์์๋ ์ ํํ ์๋ํ๋ค๋ ๋ณด์ฅ์ ์์ >> ์ ์ผํค ์๊ณ ๋ฆฌ์ฆ์ = (๋ฑํธ) ๊ฒฝ์ฐ๋ฅผ ๋นผ์ง์์๋ค๋ฉด ์ค๋ณตํค ํ๊ฒฝ์์๋ ์๋ํ ๊ฒ์ด๋ผ๊ณ ๊ต์๋์ด ๊ฐ์ ์ค ์ธ๊ธํ์ฌ ์๋ ์ฝ๋๋ ์ํฅ์์ผ๋ก ํ์ ์์ฑํ๊ณ ์ฌ๊ทํจ์๋ฅผ ์ด์ฉํด์ ์ ์๋ฆฌ ํ ์ ๋ ฌ์ ํ๋ ์๊ณ ๋ฆฌ์ฆ์ด๋ค. #include #include int H[99];// ํ int n;// ํค ๊ฐ์(ํ์ ํฌ๊ธฐ) int s;// ํ์ ์๋ ํฌ๊ธฐ ์ ์ฅ..
[ํ ์์ฑ] 1. ์ฝ์ ์ >> ๋ชจ๋ ํค๋ค์ด ๋ฏธ๋ฆฌ ์ฃผ์ด์ง ๊ฒฝ์ฐ, ๋๋ ํค๋ค์ด ์ฐจ๋ก๋ก ์ฃผ์ด์ง๋ ๊ฒฝ์ฐ ์ ์ฉ ๊ฐ๋ฅ 2. ์ํฅ์ >> ๋ชจ๋ ํค๋ค์ด ๋ฏธ๋ฆฌ ์ฃผ์ด์ง ๊ฒฝ์ฐ๋ง ์ ์ฉ ๊ฐ๋ฅ 1. ์ฝ์ ์ ํ ์์ฑ #include #include int H[99]; // ํ ๋ฐฐ์ด int n = 0; // ํ์ ํฌ๊ธฐ void upHeap(int i) {// ket ์ฝ์ ํ ์ ๋ ฌํ๋ ํจ์ int tmp; if (i == 1) return; if (H[i] = right) {// ์ค๋ฅธ์ชฝ ์์๋ ธ๋๋ ์๋ค๋ฉด if (H[max] < H[right]) {//๊ทธ๋ฆฌ๊ณ ์ผ์ชฝ ์์๋ ธ๋ ๊ฐ๋ณด๋ค ์ค๋ฅธ์ชฝ ์์๋ ธ๋ ๊ฐ์ด ํฌ๋ค๋ฉด max = right;// max์ ์ค๋ฅธ์ชฝ ์์๋ ธ๋ ์ธ๋ฑ์ค๋ฅผ ์ ์ฅ } } if (H[max]
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/xtpxL/btq5fUm5UQ1/edbmKQkIuiWwn4LH3bGBd1/img.png)
์ ๋ ฅ์์ 1 5 KimSooJin 010-1234-5678 ParkGilDong 010-2468-2468 ChungSangChul 010-1230-4567 LeeYoungHee 010-1357-2468 ChoiMyungHee 010-3458-1267 2468 ์ถ๋ ฅ์์ 1 2 LeeYoungHee 010-1357-2468 3 ParkGilDong 010-2468-2468 ์ฝ๋: #include #include #include struct customer { char id[5]; char* name; char* phone; }; int main() { struct customer* ct; int n, cnt = 0; char tmp1[51], tmp2[51]; int len1 = 0, len2 = 0; ch..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/ZoKjh/btq44O8Kx0F/VXkadfXcHxhmJvQnZDRA01/img.png)
์ ๋ ฅ์์ 1 5 KimSooJin 010-1234-5678 ParkGilDong 010-2468-2468 ChungSangChul 010-1230-4567 LeeYoungHee 010-1357-2468 ChoiMyungHee 010-3458-1267 2468 ์ถ๋ ฅ์์1 2 ParkGilDong 010-2468-2468 4 LeeYoungHee 010-1357-2468 #include #include #include struct customer { char id[5]; char* name; char* phone; }; int main() { struct customer *ct; int n, cnt = 0; char tmp1[51], tmp2[51]; int len1 = 0, len2 = 0; char nu..
- Total
- Today
- Yesterday
- AI์ปจํผ๋ฐ์ค
- gan
- ๊ตฌ๊ธ์ฝ๋ฉ
- C์ธ์ด
- HyperCLOVA
- ํ๋ก๊ทธ๋๋จธ์ค
- ๊ธฐ์ ์ปจํผ๋ฐ์ค
- ๋ ผ๋ฌธ๋ฆฌ๋ทฐ
- ์ฝํ ์ค๋น
- AIRUSH2023
- ํ์ด์ฌ์ฝํ
- WGAN
- ์ฝ๋ฉ๊ณต๋ถ
- ๋๋ฆผ๋ถ์ค
- SQL
- CLOVAX
- MYSQL
- Aimers
- DALLE
- ์คํ ์ด๋ธ๋ํจ์
- dreambooth
- ๋ ผ๋ฌธ์ฝ๊ธฐ
- StableDiffusion
- ์ฝํ
- AIRUSH
- ์ฝ๋ฉ์๋ฌ
- ํ์ด์ฌ
- ํ ํฌ์๋ฐ
- SKTECHSUMMIT
- lgaimers
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |