코딩 꼭 같이 해보면서 해보세요.. ㅠㅠ 그럼 더 이해 잘 될것 같네요..
만약 학생을 데이터로 표현하고 싶다고하면, 이름, 학번, 학년을 데이터로 저장해야 한다.
#include <iostream> | |
using namespace std; | |
int main(void) { | |
cout << "Hello, World!" << endl; | |
return 0; | |
} |
//avl트리 책에 있는 소스 수정 | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct avl_node { | |
struct avl_node *left_child, *right_child; /* Subtrees. */ | |
int data; /* Pointer to data. */ | |
}avl_node; |
#include <iostream> | |
using namespace std; | |
int f(int n) { | |
if (n < 0) return 0; | |
if (n < 2) return n; | |
return f(n - 1) + f(n - 2); | |
} | |
int main(void) { |
#include <iostream> | |
using namespace std; | |
int f(int a) { | |
a = 0; | |
return a; | |
} | |
int foo1(int b) { | |
return f(b) + 1; |
#include <iostream> | |
using namespace std; | |
int f(int n, int prev = 0, int next = 1) { | |
if (not n) return prev; | |
return f(n - 1, next, prev + next); | |
} | |
int main(void) { | |
cout << f(4) << '\n'; |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <limits> | |
#include <string> | |
#define endl '\n' | |
#define point pair<int, int> | |
using namespace std; | |
enum {notChecked = -1, notGrouped, Grouped}; |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <queue> | |
#include <limits> | |
#include <string> | |
#define endl '\n' | |
#define point pair<int, int> | |
using namespace std; |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct stack { | |
char data; | |
struct stack *next; | |
}Stack; |