일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 자바
- 빅데이터
- 레드햇
- 리눅스
- 재귀
- linux
- 자료구조
- redhat
- hadoop
- storage
- 설치
- rhcsa
- 알고리즘
- AWS
- Data Structure
- 스프링
- Spring
- recursive
- 스토리지
- 도커
- 아마존
- Redshift
- java
- data
- 하둡
- docker
- big data
- Amazon
- sort
- algorithm
- Today
- Total
목록algorithm (9)
Developer MJ
더블 링크드 리스트 insert, extract ( remove ), show 구현 import java.util.Scanner; class Node { int data; Node prev; Node next; Node(int _data) { data = _data; } static void insert(Node _head, Node _node) { Node next = _head.next; _head.next = _node; _node.prev = _head; if (next != null) { next.prev = _node; _node.next = next; } } static Node extract(Node _head, int _data) { Node current = _head.next; whi..
BST(이진 탐색 트리 : Binary Search Tree) 삽입, 검색 최소값, 최대값, 노드 갯수, 트리 높이 struct Node{ int data; Node* left; Node* right; }; int findMin(Node* root) { if(root == nullptr) { return -1; } else if (root->left == nullptr) { return root->data; } else { return findMin(root->left); } } int findMax(Node* root) { if(root == nullptr) { return -1; } else if (root->right == nullptr) { return root->data; } else { ret..
기준키(pivot)를 기준으로 작거나 같은 값을 지닌 데이터는 앞으로, 큰 값을 지닌 데이터는 뒤로 가도록 정렬 import java.util.Scanner; class Solution { static int input[]; static int num; static void quickSort(int first, int last) { int temp; if (first < last) { int pivot = first; int i = first; int j = last; while (i < j) { while (input[i] input[pivot]) { j--; } if (i < j) { temp = input[i]; input[i] = input[j]; input[j] = temp; } } temp =..
집합에 각 항목이 몇 개씩 있는지 세는 작업을 하면서 정렬 import java.util.Scanner; class Solution { static final int MAX_N = 100; static final int MAX_DIGIT = 10; static int N; // # of data set static int arr[]; static int cnt[] = new int[MAX_DIGIT]; static int sortedArr[]; static void calculateDigitNumber() { for (int i = 0; i < N; i++) { cnt[arr[i]]++; } for (int i = 1; i < MAX_DIGIT; i++) { cnt[i] = cnt[i-1] + cnt[i..
삽입 정렬 import java.util.Scanner; class Solution { static int input[]; static int num; static void insertionSort() { for (int i = 1; i = 0)) { input[j + 1] = input[j]; j = j - 1; } input[j + 1] = temp; } } static void printResult() { int i; for (i = 0; i < num; ++i) { System.out.print(input[i] + " "); } System.out.pr..