Skip to content

Instantly share code, notes, and snippets.

View dalcon10028's full-sized avatar
🐟

dalcon dalcon10028

🐟
View GitHub Profile
@dalcon10028
dalcon10028 / 체육복.java
Last active July 7, 2020 04:38
프로그래머스 코딩테스트 연습 Level-1 체육복 [ Java ]
import java.util.*;
class Solution {
public int solution(int n, int[] lost, int[] reserve) {
LinkedList<Integer> llLost = new LinkedList<>();
LinkedList<Integer> llReserve = new LinkedList<>();
Arrays.sort(lost);
Arrays.sort(reserve);
for (int i : lost) llLost.add(i);
for (int i : reserve) llReserve.add(i);
@dalcon10028
dalcon10028 / 2주차.c
Created June 28, 2020 03:25
2주차 소스코드
// 1330번 두 수 비교하기
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d", &a, &b);
if(a>b)
printf(">");
else if(a<b)
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[] num = new int[20000001];
int n = sc.nextInt();
for(int i=0; i<n; i++) num[sc.nextInt()+10000000]++;
int m = sc.nextInt();
for(int i=0; i<m; i++) System.out.print(num[sc.nextInt()+10000000]+" ");
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for(int i=0; i<n; i++) a[i] = sc.nextInt();
Arrays.sort(a);
int m = sc.nextInt();
@dalcon10028
dalcon10028 / queue.c
Created June 11, 2020 05:36
자료구조 큐
#include <stdio.h>
#define SIZE 5 /* 큐의 크기 */
int menu(void);
void view_queue(), insert_menu(), delete_menu();
int insertQ(char obj);
char deleteQ();
int isempty();
int isfull();
@dalcon10028
dalcon10028 / stack.c
Last active June 3, 2020 07:57
연결리스트를 이용한 스택
#include <stdio.h>
#include <stdlib.h>
struct _node {
char data;
struct _node *link;
};
typedef struct _node node;
@dalcon10028
dalcon10028 / 연결 리스트 실습3.c
Created June 3, 2020 05:18
연결 리스트 실습 3
#include <stdio.h>
#include <stdlib.h>
/* 노드 정의 */
struct _node {
int data;
struct _node *link;
};
typedef struct _node node;
@dalcon10028
dalcon10028 / 연결 리스트 실습2.c
Last active June 3, 2020 04:58
연결 리스트 실습 2
#include <stdio.h>
#include <stdlib.h>
// 노드의 정의
struct _node {
int data;
struct _node *link;
};
typedef struct _node node;
@dalcon10028
dalcon10028 / 연결 리스트 실습1.c
Last active June 3, 2020 04:49
연결 리스트 실습 1
#include <stdio.h>
#include <stdlib.h>
// 노드 정의
struct _node {
int data; // data
struct _node *link; // link
};
typedef struct _node node;
@dalcon10028
dalcon10028 / stack.c
Created June 1, 2020 03:00
배열을 이용한 스택 실습
#include <stdio.h>
#define SIZE 10
char stack[SIZE]; // 스택 생성
int top = -1; // 배열의 맨 위 인덱스(top)를 가리킬 변수
void view_stack(), push_menu(), pop_menu();
void topexam_menu(), isempty_menu(), isfull_menu();
void push(char obj); // 삽입(푸시)
char pop(); // 삭제(팝)