Introduction2015년도 부터 Kotlin 공부해야지 생각만하다가 시간이 없어(핑계...) 미루고 미루다 이제서야 시작 해보려한다.이미 Google 진영에서 Android에 대한 공식언어로 못밖았고 현존하는 Kotlin에 한계점들에 대한 개선이 이뤄지는데로 (Android Studio가 그랬듯이..) 점진적으로 Java 점유율을 차지 할 것으로 보여진다. 개인적으로 새로운 언어를 공부 할 때 해당언어의 기본문법에 대한 공부이후 책 한권 읽은 후 미니 프로젝트 구현 의 수순으로 하는것에 익숙해져있기에 이번에도 동일하게 진행하며 해당 내용을 정리할 예정이다.What is Kotlin?2011년 친애하는 Jetbrain 형아들이 짠 하고 공개한 언어이며 많은 내부 문법들이 스칼라를 닮아있는것으로 보아..
Explain.문제보기ApproachMerge sort, Heap sort를 활용하여 수를 정렬.본문에서는 Heap sort(MAX Heap)을 구현하여 Heap sort를 구현하였다.Code #include #include void swap(int arr[], int a, int b) { int temp = arr[a]; arr[a] = arr[b]; arr[b] = temp; } void heapfiy(int arr[], int n, int i) { int root = i; int left = i * 2 + 1; int right = i * 2 + 2; if (left < n && arr[root] < arr[left]) { root = left; } if (right < n && arr[root] ..
Explain입력된 int을 bit로 변환하여 출력해주는 코드.int 이외에도 다양한 type에 적용가능.1byte = 8bit 인점을 감안하여 반복문을 생성한뒤반복자(i)를 기준으로 mask생성 후 출력.Code #include #include typedef int TYPE; void display_bit(TYPE x); int main(void) { TYPE input; scanf("%d", &input); display_bit(input); } void display_bit(TYPE x) { int i; for (i = sizeof(x) * 8; i-- > 0;) { if (x & 1
Explain문제보기본 풀이에서는 위 문제에서 결과로 요청한 최소 검은 방의 수 뿐만 아니라 해당결과의 경로까지 출력한다.Approachdijkstra algorithm을 활용하여 풀이하였으며shorter path를 구하기위한 자료구조로써 priority queue를 구현.자세한 내용은 추후 정리.Code #include #include #include typedef struct { int x; int y; int px; int py; int value; } heapNode; typedef struct { heapNode* heap; int size; } PQ; void insert(heapNode aNode, heapNode* heap, int size) { int idx; heapNode tmp; i..
- Total
- Today
- Yesterday
- DNS
- 도메인
- 삼항연산자
- Matrix
- 비트연산자
- 안드로이드
- C
- 수식
- 알고리즘
- Android
- highlightjs
- Math
- 비트
- 행렬
- algorithm
- python
- 비트마스크
- robocopy
- Kotlin
- Bit
- mathjax
- mysql
- syntax highlighting
- Highlighter
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |