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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Road API</title> | |
</head> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.6.2/proj4.js" integrity="sha512-cgJnZ1VX2G0MAN4C5OGShwI3zHhfQ6RLriXuukhblNu+T082/ZRGoWLP/0xMKObvB6AUKdnm27hQKj8hKZPjXA==" crossorigin="anonymous"></script> | |
<script> |
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
public class StringZip { | |
public int solution(String s) { | |
//System.out.println(s); | |
int minLength = s.length(); | |
for (int unit = 1; unit <= s.length() / 2; unit++) { // for #01 | |
String composeStr = ""; | |
int repeatCnt = 1; | |
String preStr = ""; | |
String postStr = s; |
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
package programers; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class StringZip { | |
public int solution2(String s) { | |
int minResult = s.length(); | |
for (int unit = 1; unit <= s.length() / 2; unit++) { // for #01 | |
int resultLength = unit; |
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
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
String n = sc.next(); | |
char[] arrChar = n.toCharArray(); | |
for (int i = 0; i < arrChar.length; i++) { |
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> | |
#include <numeric> | |
#include <math.h> | |
using namespace std; | |
int main() { | |
int a[7] = {0,500,300,200,50,30,10}; |
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
public class BinarySearchTree { | |
public static Node root; | |
public BinarySearchTree() { | |
this.root = null; | |
} | |
/** | |
* tree 에서 key 로 node 를 탐색합니다. | |
* @param id |
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
import java.util.Comparator; | |
import java.util.PriorityQueue; | |
public class Test | |
{ | |
public static void main(String[] args) | |
{ | |
Comparator<String> comparator = new StringLengthComparator(); | |
PriorityQueue<String> queue = | |
new PriorityQueue<String>(10, comparator); |
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
class CustomString implements Comparable<CustomString> { | |
public String str; | |
public CustomString(String str) { | |
this.str = str; | |
} | |
public int compareTo(CustomString cs) { | |
int leng1 = this.str.length(); |
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
/** | |
* heapify 함수를 활용하여 Heap 을 구축합니다. | |
* @param arr | |
* @param nodeIndex | |
* @param heapSize | |
*/ | |
void buildHeap(int[] arr, int nodeIndex, int heapSize) { | |
if(nodeIndex >= heapSize/2) return; | |
buildHeap(arr, 2 * nodeIndex + 1, heapSize); // buildHeap- left subTree | |
buildHeap(arr, 2 * nodeIndex + 2, heapSize); // buildHeap- right subTree |
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
/** | |
* node의 childe node를 비교하여 히프화합니다. | |
* @param arr | |
* @param nodeIndex 히프화할 node 의 번호입니다. | |
* @param heapSize 완전 이진 트리의 크기입니다. | |
*/ | |
void heapify(int[] arr, int nodeIndex, int heapSize) { | |
int ai = arr[nodeIndex]; | |
while (nodeIndex < heapSize/2) { // arr[i] 는 leaf 가 아닌경우만 loop 를 순환합니다. | |
int j = 2 * nodeIndex + 1; // j는 ai의 좌측 자식 노드의 index 입니다. |
NewerOlder