블로그
-
자료구조- 연결 리스트 구현
} while (ch == 'y' || ch == 'Y') { item = (ListNode *)malloc(sizeof(ListNode)); if (item == NULL) return 0; printf("값 입력 : "); scanf_s("%d", &(item->data)); item->link = NULL; if (*h == NULL) *h
blog.naver.com · 2018.10.17
-
큐를 이용한 대기순번 시뮬레이션 프로그램
#include #include #include #include #define TRUE 1 #define FALSE 0 #define MAX_QUEUE_SIZE 100 typedef } int is_empty(QueueType *q) { return q->front == q->rear; } int is_full(QueueType *q) { return
blog.naver.com · 2018.08.27
-
프로그래머스 LEVEL.2 가장 큰 정사각형 찾기
표에서 1로 이루어진 가장 큰 정사각형을 찾아 넓이를 return 하는 solution 함수를 완성해 주세요. (단, 정사각형이란 축에 평행한 정사각형을 말합니다.) 이 문제를 어떻게 해결해야 될지 생각해보다, 나의 첫 생각은 배열의 (i=0,j=0)부터 시작하여 현 위치(i,j), 오른쪽(i+1,j), 아래(i,j+1), 대각선 오른 아래(i,
blog.naver.com · 2018.09.21
-
원형 큐 프로그램
) { fprintf(stderr, "%s", message); exit(1); } void init(QueueType *q) { q->front = q->rear = 0; } int is_empty(QueueType *q) { return (q->front == q->rear); } int is_full(QueueType *q) { return
blog.naver.com · 2018.08.12
-
자료구조 덱 프로그램
#include #include #include #define TRUE 1 #define FALSE 0 typedef int element; typedef struct DlistNode TRUE; else return FALSE; } DlistNode *create_node(DlistNode *llink, element data, DlistNode *rli....
blog.naver.com · 2018.08.18
-
프로그래머스 LEVEL.2 다음 큰 숫자
자연수 n이 매개변수로 주어질 때, n의 다음 큰 숫자를 return 하는 solution 함수를 완성해주세요. #include #include using namespace std; int BinaryMethod(int m){ int p=0; for(int i=0;0
blog.naver.com · 2018.09.18
-
c언어 자료구조 스택을 이용한 괄호 검사
#include #include #include #define MAX_STACK_SIZE 100 #define FALSE 0 #define TRUE 1 typedef char element (s->top == -1); } int is_full(StackType *s) { return s->top == (MAX_STACK_SIZE-1); } .......
blog.naver.com · 2018.08.05
-
[알고리즘문제풀기] Level 1. 같은 숫자는 싫어(java)
합니다. * 예를들면 * arr = [1, 1, 3, 3, 0, 1, 1] 이면 [1, 3, 0, 1] 을 return 합니다. * arr = [4, 4, 4, 3, 3] 이면 [ 4, 3] 을 return 합니다. * 배열 arr에서 연속적으로 나타나는 숫자는 제거하고 남은 수들을 return 하는 solution 함수를 완성해 주세요. * 제한사......
blog.naver.com · 2018.05.25
-
18.05.11 Java
.*; class Box { int w, h, l; public Box() { w = 0; h = 0; l = 0; } public Box(int w, int h, int l) { w*h*l;} public int area() {return 2*(w*h+h*l+l*w);} public String toString() { return String.format(
blog.naver.com · 2018.05.11
-
18.03.23 JAVA
=0) { z = x%y; x = y; y = z; } return x; //최대공약수 값 반환 } }
blog.naver.com · 2018.03.23