This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#define node_num 7 | |
//node struct | |
typedef struct node | |
{ | |
char alphabet; //alphabet | |
struct node* left; //left child node | |
struct node* right; //right child node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#define node_num 26 | |
//node struct | |
typedef struct node | |
{ | |
char alphabet; //alphabet | |
struct node* left; //left child node | |
struct node* right; //right child node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#pragma warning(disable:4996) | |
//이진검색트리노드 | |
typedef struct treenode { | |
int data; | |
struct treenode* left; | |
struct treenode* right; | |
}treenode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<map> | |
#include<functional> | |
using namespace std; | |
//print map element | |
void print(map<int, char> m) | |
{ | |
//empth function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
//swap | |
void swap(int &a, int &b) | |
{ | |
int temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#define MAX 100 | |
using namespace std; | |
//make row major ordering | |
int (*make_row_major(int a, int b))[MAX] | |
{ | |
int arr[MAX][MAX] = { 0 }; | |
int temp = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<algorithm> | |
#include<stack> | |
using namespace std; | |
int graph[1001][1001]; //Graph | |
//N : Number of vertex | |
//M : Number of edge | |
//V : Start vertex number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<algorithm> | |
#include<queue> | |
using namespace std; | |
int graph[1001][1001]; //Graph | |
//N : Number of vertex | |
//M : Number of edge | |
//V : Start vertex number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int main() { | |
int A[21][301] = { 0 }; //A[i][j] : 기업 i가 j금액을 투자했을 때 얻는 이익 | |
int DP[21][301] = { 0 }; //D[i][j] : j금액을 i까지의 기업들이 투자했을 때 얻는 최대 이익 | |
int path[21][301] = { 0 }; | |
int path_money[21] = { 0 }; | |
int money, num;//투자 금액, 기업 갯수 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; //입력하는 데이터 갯수 | |
int ind = 0; //d 인덱스 | |
int arr[1000] = { 0 }; | |
int d[1000] = { 0 }; |