본문 바로가기
728x90
반응형

전체 글265

배포 전략 1. 인플레이스 배포(In-place Deployment) AWS의 Codedeploy가 대표적으로 이 방식을 사용한다. AWS CodeDeploy: 개발자가 EC2 인스턴스 및 온프레미스에서 실행 중인 인스턴스를 비롯한 모든 인스턴스에서 소프트웨어를 배포하고 업데이트하도록 지원하는데 초점을 맞춘 빌링 블록 서비스 배포 그룹의 각 환경에 있는 어플리케이션을 일시정지한 후 최신 상태의 어플리케이션 업데이트를 실행한다. 로드밸런서를 사용하면 인스턴스가 배포중이더라도 등록을 해제할 수 있고 배포 후에도 이전 버전으로 복원이 가능하다. 2. 롤링 배포(Rolling Update Deployment) 현재 위치 배포, 한개의 Load Balancer가 4개의 서버로 골고루 요청을 보낸다. 로드밸런서에서 연결된 서.. 2024. 4. 20.
Architecture patterns 1. Layered architecture This pattern separates a system's components into distinct layers, typically the presentation layer, business logic layer, and data access layer. For instance, we often see the Model-View-Presenter(MVP) pattern in user interface design. It is a specialized form of layered architecture. The primary goal of layered architecture is to promote separation so changes in one lay.. 2024. 4. 18.
637. Average of Levels in Binary Tree 이진 트리의 각 레벨에 있는 노드들의 평균 값을 계산하는 문제입니다. 이진 트리의 루트가 주어지면, 각 레벨의 노드들의 평균 값을 배열 형태로 반환해야 합니다.이진 트리의 각 레벨에 있는 노드들의 평균 값을 계산하는 문제입니다. 이진 트리의 루트가 주어지면, 각 레벨의 노드들의 평균 값을 배열 형태로 반환해야 합니다. 실제 답과 10^-5 이내의 오차는 허용됩니다. /** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNode left; * public TreeNode right; * public TreeNode(int val=0, TreeNode left=null, TreeNode .. 2024. 4. 18.
98. Validate Binary Search Tree 이진 트리가 유효한 이진 탐색 트리(Binary Search Tree, BST)인지 판별하는 것입니다. 노드의 왼쪽 서브트리에는 노드의 키보다 작은 키를 가진 노드만 포함되어 있습니다. 노드의 오른쪽 서브트리에는 노드의 키보다 큰 키를 가진 노드만 포함되어 있습니다. 왼쪽과 오른쪽 서브트리 모두 이진 탐색 트리여야 합니다. 예시 1: 입력: root = [2,1,3], 출력: true 예시 2: 입력: root = [5,1,4,null,null,3,6], 출력: false. 설명: 루트 노드의 값은 5이지만, 그 오른쪽 자식 노드의 값은 4입니다. 트리의 노드 수는 범위 [1, 10^4] 내에 있습니다. 노드의 값은 -2^31 2024. 4. 17.
findProfession 이진 트리의 특정 레벨과 위치에 있는 사람의 직업을 결정하는 문제입니다. 만약 레벨이 1인 경우, 해당 사람의 직업은 "Engineer"입니다. 그렇지 않은 경우, 해당 사람의 직업은 부모의 직업에 따라 결정됩니다. 부모가 "Engineer"인 경우, 해당 사람의 위치에 따라 “Engineer” 또는 "Doctor"로 번갈아가며 결정됩니다. 부모가 "Doctor"인 경우, 해당 사람의 위치에 따라 직업이 반대로 결정됩니다 (짝수 위치는 “Engineer”, 홀수 위치는 “Doctor”). string solution(int level, int pos) { return findProfession(level,pos); } string findProfession(int level,int pos){ if(pos.. 2024. 4. 8.
CI/CD CI/CD, or Continuous Integration and Continuous Delivery, automates the software development process from the initial code commit all the way through to deployment. It eliminates much of the manual human intervention traditionally required to get new code to production. This process takes care of building,testing, and deploying new code to production. The promise is that it enables software team.. 2024. 4. 8.
isTreeSymmetric 주어진 이진 트리가 중심을 기준으로 대칭인지 여부를 판단하는 문제입니다. 이를 확인하기 위해서는 각 측면이 서로 거울처럼 반영되는지 확인해야 합니다. 트리가 비어 있으면 대칭이라고 판단합니다. 그렇지 않은 경우, 왼쪽 서브트리와 오른쪽 서브트리를 비교하여 값이 같은지 확인합니다. 서브트리들이 대칭적으로 구성되어 있는지 재귀적으로 확인합니다. // // Binary trees are already defined with this interface: // class Tree { // public T value { get; set; } // public Tree left { get; set; } // public Tree right { get; set; } // } bool solution(Tree t) { .. 2024. 4. 5.
hasPathWithGivenSum 이진 트리에서 특정 합계를 갖는 경로가 있는지 확인하는 문제를 해결하는 함수입니다. 주어진 이진 트리는 각 노드가 정수 값을 가지고 있습니다. // // Binary trees are already defined with this interface: // class Tree { // public T value { get; set; } // public Tree left { get; set; } // public Tree right { get; set; } // } bool solution(Tree t, int s) { return hasPathWithGivenSum(t,s); } bool hasPathWithGivenSum(Tree t, int s){ if(t == null) return false; i.. 2024. 4. 2.
728x90
반응형