-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from min050410/develop
add: postitem 스타일 수정, 블로그 업로드
- Loading branch information
Showing
32 changed files
with
412 additions
and
286 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,50 @@ | ||
# Big-O 표기법과 수행 | ||
**Big O** **sort** **dp** | ||
|
||
## 알고리즘 전체 목차 | ||
- 알고리즘의 개념 | ||
- Big-O 표기법과 수행 | ||
- 재귀 | ||
- 정렬 알고리즘 | ||
- 선택 | ||
- 버블 | ||
- 삽입 | ||
- 퀵 | ||
- 합병 | ||
- 정렬 코드의 수행 시간 | ||
- 탐색 알고리즘 | ||
- 순차 | ||
- 이진 | ||
- 분할정복법 | ||
- 동적계획법 | ||
- 해싱 | ||
- 선형조사법 | ||
- 이차조사법 | ||
- 이중해싱법 | ||
- 체인법 | ||
|
||
> 추후에 업데이트 | ||
### 알고리즘의 개념 | ||
|
||
알고리즘의 조건 | ||
1. `유한성` | ||
2. `명확성` | ||
3. `입력` | ||
4. `출력` | ||
5. `효과성` | ||
|
||
### 알고리즘의 수행시간 | ||
|
||
O(Big-o)표기법 : 자료에 따라 알고리즘이 수행되는 최악의 경우의 성능을 표시하는 방법 | ||
|
||
> 알고리즘 수행 세는 방법 | ||
```c | ||
int n=0; --> 1번 | ||
for(int i=1; i<=n; i++) --> n+1번 | ||
{ | ||
print("dlsfjak"); --> n번 | ||
} | ||
int n=0; -> 1번 | ||
for (int i=1; i<=n; i++) -> n+1번 | ||
{ | ||
print("dlsfjak"); -> n번 | ||
} | ||
``` | ||
|
||
코드 한 줄에 수행 한 번을 기본으로 한다. | ||
`for`문의 경우에는 `i`가 `n`번까지 돌고 조건을 검사하면서 한번 더 돌게 되므로 `n+1`번 `for`문 안에는 `n`번이다. | ||
> 주의해야 할 점 | ||
> 함수의 선언부나, 매크로, 라이브러리 불러오는 코드는 수행에 포함되지 않는다 | ||
감이 안잡힌다면 예제를 더 살펴보자 | ||
|
||
```c | ||
#include <stdio.h> | ||
int main() { | ||
int n=0; --> 1 | ||
int a=1; --> 1 | ||
scanf("%d",&n); --> 1 | ||
for(int i=1; i<=n; i++) { --> n+1 | ||
for(int j=1; j<=n; j++) { --> (n+1)*n | ||
for(int k=1; k<=n; k++) { --> (n+1)*n*n | ||
printf("%d ",k); --> n*n*n | ||
int n=0; -> 1 | ||
int a=1; -> 1 | ||
scanf("%d",&n); -> 1 | ||
for (int i=1; i<=n; i++){ -> n+1 | ||
for (int j=1; j<=n; j++){ -> (n+1)*n | ||
for (int k=1; k<=n; k++) -> (n+1)*n*n{ | ||
printf("%d ",k); -> n*n*n | ||
} | ||
printf("%d ",j); --> n*n | ||
printf("%d ",j); -> n*n | ||
} | ||
printf("%d ",i); --> n | ||
} | ||
return 0; --> 1 | ||
} | ||
printf("%d ",i); -> n | ||
} | ||
return 0; -> 1 | ||
} | ||
``` | ||
~~for문안에 for문안에 for문~~ | ||
`for`문은 앞에서 `n+1`의 수행을 갖는다고 설명하였다. | ||
`for`문은 앞에서 `n+1`의 수행을 갖는다고 설명하였다. | ||
따라서 첫번째로 감싸는 `for`문이 `n+1`인 것을 확인할 수 있다. | ||
2번째로 감싸는 `for`문은 1번째로 감싸는 `for`문의 안의 값이므로 `n`번의 수행을 갖는다. | ||
그리고 `for`문은 `n+1`의 수행을 가지므로 결과적으로 `n*(n+1)`번 실행된다. | ||
나머지 수행 시간도 같은 접근 방식으로 유추할 수 있다. | ||
> 주의해야 할 점 | ||
함수의 선언부나, 매크로, 라이브러리 불러오는 코드는 수행에 포함되지 않는다 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 개인 블로그를 개발한 이유 - Devlog | ||
|
||
> `markdown` 으로 빠르게 편집 가능하고 | ||
> `TIL`에 쓴 내용을 블로그에 빠르게 적용이 가능하고 | ||
> 정적인 블로그 제작을 원했다. | ||
그렇게 찾다 보니 `Gatsby` 라는 `react` 기반의 프레임워크를 찾았다. | ||
`react`기반이라 경험을 살려 `typescript`로 개발을 시작하고 블로그는 1주일 후에 모습을 드러내게 되었다. | ||
|
||
직접 개발한 블로그의 장점을 소개하겠다 | ||
|
||
### url query 형식으로 유동적인 블로그 관리가 가능하다 | ||
|
||
```text | ||
https://devlog.kro.kr/postitem?name=ohmyposh | ||
``` | ||
|
||
위 링크에서 볼 수 있듯이, | ||
`?name=ohmyposh`를 이용해서 블로그를 추가하면 자동으로 | ||
`ohmyposh.md`라는 파일을 랜더링하도록 제작했다. | ||
|
||
### 블로그의 모든 정보들을 배열에 저장해 빠른 참조가 가능하다 | ||
|
||
```ts | ||
{ | ||
id: 1, | ||
title: 'Big-O 표기법과 수행', | ||
filename: 'Algorithm', | ||
img: 'algorithm', | ||
date: '2021-12-20', | ||
tag: 'Big O', | ||
tag2: 'sort', | ||
tag3: 'DP', | ||
filter: 'c' | ||
}, | ||
``` | ||
이렇게 정보들이 배열로 저장되어 있어 참조하기도 쉽고 정보를 수정하기도 용이하다. | ||
|
||
### 마크다운으로 작성하면 알아서 블로그의 테마에 맞게 알아서 변환해준다. | ||
|
||
`gatsby-plugin-mdx` 을 적용하고 `css`에 손을 봐서 가능해졌다. | ||
`react-prism-renderer`를 이용해 `markdown`의 `syntax highlighting`을 적용했다. | ||
|
||
### 자체 클라우드가 무료이다 | ||
|
||
`gatsby`의 자체 클라우드로 `gatsby cloud` 서비스를 사용했다. | ||
첫 배포는 무료였고, 사용해보니 웹사이트도 편리하고 클라우드를 사용하기 편했다. | ||
혹시 관심있으면 아래 링크로 가보길 바란다. | ||
|
||
[gatsby cloud](https://www.gatsbyjs.com/products/cloud/) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## react-native 카메라 적용 방법 | ||
# react-native 카메라 적용 방법 | ||
|
||
**react-native** **module** **camera** | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# heap sort 개념 | ||
|
||
자료구조 힙 | ||
|
||
c++에서 priority_queue 자료형으로 구현 가능한 자료구조이다. | ||
|
||
기본적으로 트리 자료 구조를 가지고 있으며, | ||
`max heap`과 `min heap`이 존재하는데 우선순위 큐를 위해 만들어진 자료구조이다. | ||
|
||
우선순위 큐를 이용하면 최댓값 or 최솟값을 `log n` 의 복잡도로 뽑아낼 수가 있다. | ||
|
||
대표적인 사용처는 `min heap`을 이용한 다익스트라 알고리즘이다. | ||
|
||
### 힙 정렬이란 | ||
|
||
최대 힙 트리나 최소 힙 트리를 구성해 정렬을 하는 방법이다. | ||
|
||
> 과정 | ||
i. 정렬해야 할 n개의 요소들로 최대 힙을 만든다. | ||
-> 오름차순 기준이라면 최소 힙을 사용한다. | ||
|
||
ii. 그 다음으로 한번에 하나씩 요소를 힙에서 꺼내서 배열의 뒤부터 저장한다. | ||
|
||
iii. 삭제되는 요소들은 값이 감소되는 순서로 정렬되게 한다. | ||
|
||
> 코드 | ||
```cpp | ||
void heap_sort(element a[], int n){ | ||
int i; | ||
HeapType h; | ||
|
||
init(&h); | ||
|
||
for (i=0; i<n; i++){ | ||
insert_max_heap(&h, a[i]); | ||
} | ||
for (i=(n-1); i>=0; i--){ | ||
a[i] = delete_max_heap(&h); | ||
} | ||
} | ||
``` | ||
### 시간 복잡도 | ||
|
||
거의 완전 이진트리여서 삽입 or 삭제시 `log2n` | ||
|
||
요소의 개수가 n 개이므로 최종적으로 | ||
`O(nlog2n)`의 시간이 걸린다. | ||
|
Oops, something went wrong.