전체 글
-
[BOJ] 15649번: N과 M(1)Algorithm/Baekjoon Online Judge 2022. 3. 31. 02:09
https://www.acmicpc.net/problem/15649 15649번: N과 M (1) 한 줄에 하나씩 문제의 조건을 만족하는 수열을 출력한다. 중복되는 수열을 여러 번 출력하면 안되며, 각 수열은 공백으로 구분해서 출력해야 한다. 수열은 사전 순으로 증가하는 순서로 출력해 www.acmicpc.net Python3 백트랙킹 알고리즘으로 해결하는 방식과 파이썬 내장함수를 사용하여 해결하는 방식 2가지로 풀어보았다. Code 1 from itertools import permutations if __name__ == '__main__': N, M = map(int, input().split()) numbers = [i for i in range(1, N+1)] for item in permuta..
-
[Algorithm] 백트랙킹(BackTracking)Algorithm/Algorithm Theory 2022. 3. 31. 01:51
백트랙킹 백트랙킹은 가능한 모든 방법을 탐색한다. 즉, 현재 상태에서 가능한 모든 후보를 따라 후보를 다시 탐색하면서 해를 찾아나가다가 해가 아니라고 판단되면 다시 되돌아가 다른 후보를 탐색하여 해를 찾아가는 방식이다. 이는 최적화 문제와 결정문제를 푸는 방법이 된다. 위의 상황을 트리에 적용해보면 트리 탐색 알고리즘이라고 생각할 수 있다. 트리 탐색 알고리즘은 방식에 따라서 깊이 우선 탐색(Deep First Search, DFS), 너비 우선 탐색(Breadth First Search, BFS)으로 나눌 수 있다. 백트랙킹은 모든 경우의 수를 고려해야하기에 DFS로 구현한다. 더보기 DFS(Deep First Search) 트리의 root에서 바닥에 도달할 때까지 한 쪽에서 시작하여 가능한 모든 경로..
-
[Network] NAT(Network Address Translation)이란?Computer Science/Network 2022. 3. 29. 00:10
NAT (Network Address Translation) NAT은 ip패킷의 TCP/UDP 포트 숫자와 소스 및 목적지의 IP주소 등을 재기록하면서 라우터를 통해 네트워크 트래픽을 주고 받는 기술이다. 간단히 말하면 사설 ip를 공인 ip로 변경해주는 네트워크 주소 변환 기술이다. 여러개의 호스트가 존재하는 기업이나 회사에서는 내부망에서 사용하는 pc에 사설 ip를 제공하고 외부 인터넷 연결 시에 공인 IP하나를 같이 사용한다. 각 사설 IP는 그에 해당하는 port를 가지고 있는데 이는 공인 ip로 외부 인터넷 통신 후 응답을 받을 때 해당하는 호스트에게 보내주기 위해서이다. 즉 각 호스트 구분을 위해 호스트끼리 서로 다른 port를 사용한다. ex> 192.168.1.1이 외부 인터넷 통신을 원하..
-
[Minikube] Virtual box Ubuntu20.04에 minikube 설치Backend/Kubernetes 2022. 3. 27. 16:43
minikube Kubernetes는 마스터 노드와 하나 이상의 워커 노드를 구성해야한다. 개발 테스트를 위해서 이를 구성하기에는 쉽지 않기 때문에 마스터 노드의 일부 기능과 개발 및 배포를 위한 단일 워커 노드를 제공해 주는 간단한 Kubernetes 플랫폼 환경을 제공해주는데 이를 minikube라고 한다. 즉 단일 노드로 구성된 간단한 클러스터를 배포하는 경량화된 쿠버네티스! minikube 설치 환경 나의 경우 현재 Virtual box위의 ubuntu20.04 가상머신 위에서 minikube를 설치하려고 한다. 우분투에서 minikube 설치를 위해서는 Docker와 Virtual box를 설치해주어야한다. 따라서 다음 과정을 진행 후 minikube를 설치한다. docker 설치 나의 이전 d..
-
[Docker] Virtual box Ubuntu 20.04에 Docker 설치하기Backend/Docker 2022. 3. 27. 16:10
윈도우 OS를 사용하고 있지만 리눅스 OS에서 Docker를 사용해야하는 일이 생겨 Virtual box를 이용해 Ubuntu 가상머신을 만들었다. 이때 ubuntu 20.04버전을 기준으로 Docker를 설치하는 명령어를 포스트한다. Docker 설치 우분투 버전 확인 cat /etc/issue 기존에 docker를 설치한 적이 있다면 오래된 버전일 경우 최신 버전 설치를 위해 삭제해준다. sudo apt-get remove docker docker-engine docker.io containerd runc repository 설정 # apt package index 업데이트 및 package 설치 sudo apt update sudo apt install apt-transport-https ca-ce..