This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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