Skip to content

Instantly share code, notes, and snippets.

View keehyun2's full-sized avatar
πŸ˜ͺ
zzzz

Keehyun Park keehyun2

πŸ˜ͺ
zzzz
View GitHub Profile
@keehyun2
keehyun2 / UTMK_TO_WGS84.html
Last active November 24, 2020 06:47
https://www.data.go.kr/ μ—μ„œ μ œκ³΅ν•˜λŠ” utm-k λ₯Ό wgs84 둜 λ³€κ²½ν•˜λŠ” 방법
<!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>
@keehyun2
keehyun2 / StringZip.java
Created February 7, 2020 07:20
λ¬Έλ°”μ—΄ μ••μΆ• - μˆ˜ν–‰μ‹œκ°„ κ°œμ„ ... (λ‹€λ₯Έμ½”λ“œ 많이 μ°Έμ‘°ν–ˆμŠ΅λ‹ˆλ‹€)
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;
@keehyun2
keehyun2 / StringZip.java
Created February 7, 2020 01:20
λ¬Έμžμ—΄ μ••μΆ• 문제 https://programmers.co.kr/learn/courses/30/lessons/60057
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;
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++) {
#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};
@keehyun2
keehyun2 / BinarySearchTree.java
Created April 27, 2018 02:18
BinarySearchTree
public class BinarySearchTree {
public static Node root;
public BinarySearchTree() {
this.root = null;
}
/**
* tree μ—μ„œ key 둜 node λ₯Ό νƒμƒ‰ν•©λ‹ˆλ‹€.
* @param id
@keehyun2
keehyun2 / StringLengthComparator.java
Created January 28, 2018 04:11
Comparator κ΅¬ν˜„
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);
@keehyun2
keehyun2 / CustomString.java
Created January 28, 2018 04:10
CustomString
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();
@keehyun2
keehyun2 / buildHeap.java
Created January 28, 2018 04:09
buildHeap
/**
* 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
@keehyun2
keehyun2 / heapify.java
Created January 28, 2018 04:09
heapify
/**
* 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 μž…λ‹ˆλ‹€.