분류 전체보기
-
java final 의미, 사용법Backend/Java 2022. 12. 27. 23:53
Java에서 final은 "불변성"을 확보하기 위해 존재한다. 즉, 클래스나 변수 앞에 final을 붙이면 처음 정의된 상태가 변하지 않는 것을 보장한다. 4가지 경우에 대해 final을 사용할 수 있다. 1. final 변수 final String hello = "Hello world"; final 키워드가 붙은 변수는 초기화 후 변경할 수 없다. 다음과 같이 변경하려고 하면 컴파일 에러가 발생한다. final String hello = "Hello world"; hello = "See you around" // compile error! 2. final arguments (인자) final로 선언된 인자는 메소드 내에서 변경이 불가능하다. 따라서 다음과 같이 final int로 선언한 number는 ..
-
🎵542. 01 Matrix javaLeetCode_Study_Plan/Algorithm 2022. 12. 27. 23:44
https://leetcode.com/problems/01-matrix/description/ 01 Matrix - LeetCode 01 Matrix - Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: [https://assets.leetcode.com/uploads/2021/04/24/01-1-grid.jpg] Input: mat = [[0,0,0],[0,1,0],[0,0, leetcode.com 나의 경우 dfs로만 접근했었는데, 4가지 방향에 대해 우선적으로 칼큘레이션이 되었다가 그 다음 방향으..
-
DOM과 Virtual DomFrontend/etc 2022. 12. 26. 19:08
1. DOM(Document Object Model) 넓은 의미로는 웹 브라우저가 HTML 페이지를 인식하는 방식이며, 좁은 의미로는 document 객체와 관련된 객체의 집합을 의미할 수 있다. DOM은 아래와 같은 트리구조로 이루어져 있고 다양한 node들이 존재한다. 일반적인 노드 유형은 아래와 같다. DOCUMENT_NODE (ex. window.document) ELEMENT_NODE (ex. , , , , , , ) ATTRIBUTE_NODE (ex. class="hi") TEXT_NODE (ex. 줄바꿈과 공백을 포함한 HTML 문서 내의 텍스트) DOCUMENT_FRAGMENT_NODE (ex. document.createDocumentFragment()) DOCUMENT_TYPE_NODE..
-
116. Populating Next Right Pointers in Each NodeLeetCode_Study_Plan/Algorithm 2022. 12. 26. 14:22
https://leetcode.com/problems/populating-next-right-pointers-in-each-node/description/ Populating Next Right Pointers in Each Node - LeetCode Populating Next Right Pointers in Each Node - You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: struct Node { int val; Node *left; Node *right; Node ..
-
🎵 617. Merge Two Binary Trees javaLeetCode_Study_Plan/Algorithm 2022. 12. 26. 13:00
https://leetcode.com/problems/merge-two-binary-trees/ Merge Two Binary Trees - LeetCode Merge Two Binary Trees - You are given two binary trees root1 and root2. Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. leetcode.com public class Solution { public TreeNode m..
-
695. Max Area of Island javaLeetCode_Study_Plan/Algorithm 2022. 12. 22. 21:39
https://leetcode.com/problems/max-area-of-island/ Max Area of Island - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { int m; int n; boolean[][] visited; int[][] grid; int cnt = 0; public int maxAreaOfIsland(int[][] grid) { this.m = grid.length; this.n = grid[0].le..
-
BFF(BackEnd-For-FrontEnd)Frontend/etc 2022. 12. 22. 20:58
BFF방식의 도입은 MSA와 연관이 있다. 아래는 MSA에 관한 자세한 설명이다. https://lulu-developmentlog.tistory.com/124 MSA(Microservice Architecture) MSA와 애자일 MSA는 1개의 시스템을 독립적으로 배포 가능한 각각의 서비스로 분할한다. 각각의 서비스는 API를 통해 데이터를 주고 받으며 1개의 큰 서비스를 구성합니다. 모든 시스템의 구성요소가 한 프로젝 lulu-developmentlog.tistory.com 서비스의 규모가 커지면서 점차적으로 기업들은 MSA 방식을 채택하고 MSA에서는 각 서비스를 도메인 별로 분리시킨다. FE 관점에서 이를 바라보면, FE의 궁극적인 업무는 화면에 필요한 데이터를 렌더링하는 일이다. MSA 구조에..
-
733. Flood Fill javaLeetCode_Study_Plan/Algorithm 2022. 12. 22. 14:46
https://leetcode.com/problems/flood-fill/description/ Flood Fill - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { int[][] image; int m; int n; int newColor; int oldColor; boolean [][] visited; public int[][] floodFill(int[][] image, int sr, int sc, int color) { th..