분류 전체보기

    [LeetCode] Longest Common Subsequence (Java)

    ✉️문제 https://leetcode.com/problems/longest-common-subsequence/description/ Longest Common Subsequence - LeetCode Can you solve this real interview question? Longest Common Subsequence - Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence of a string is a new string genera leetcode.com 🗝 문제풀이 2차원 배열을 ..

    [LeetCode] Longest Increasing Subsequence (Java)

    ✉️문제 https://leetcode.com/problems/longest-increasing-subsequence/description/ Longest Increasing Subsequence - LeetCode Can you solve this real interview question? Longest Increasing Subsequence - Given an integer array nums, return the length of the longest strictly increasing subsequence. Example 1: Input: nums = [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest leetcode.com 📝 접근 1. 다이..

    [LeetCode] Non-overlapping Intervals (Java)

    ✉️문제 https://leetcode.com/problems/non-overlapping-intervals/description/ Non-overlapping Intervals - LeetCode Can you solve this real interview question? Non-overlapping Intervals - Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. leetcode.com 🗝 문제풀이 겹치는 부분을 최소화..

    Today I Learned

    Today I Learned

    [Java] JVM이란? 가비지 컬렉션(GC) 자바의 쓰레드 자바의 쓰레드 동기화 Volatile 람다와 스트림 [Spring] Spring Security Toby Spring [JPA] JPA의 필요성: 객체와 데이터베이스 간의 격차 해소하기 JPA의 장점과 그 원리(feat.영속성 컨텍스트) JPA 영속성 컨텍스트 생명주기 (OSIV) 연관관계의 주인이 다쪽에 있는 이유 [DB] 테이블 설계와 정규화 [OS] 공룡책 [Network] 컴퓨터 네트워크 하향식 접근 [개발 서적] 객체지향의 사실과 오해 Effective Java [알고리즘] Github LeetCode 문제풀이 [프로젝트 기록] 프로젝트 기록

    [Java] Volatile 키워드

    [Java] Volatile 키워드

    🔍 멀티 코어 프로세서 멀티 코어 프로세서에는 코어마다 별도의 개시를 가지고 있기 때문에 멀티 쓰레드 프로그래밍의 결과가 제대로 동작하지 않을 수 있다. L1캐시와 L2캐시에 대해서 간단히 설명하면 다음과 같다. L1 캐시는 CPU 코어에 가장 가까운 위치에 있어 빠르게 접근할 수 있지만 용량이 작다. L2 캐시는 L1캐시보다 크며 속도는 느리다. 여러 코어간의 데이터 공유를 위한 캐시로 사용된다. 코어는 메모리에서 읽어온 값을 캐시에 저장하고 캐시에서 값을 읽어서 작업한다. 따라서 다시 값을 읽어올 때는 먼저 캐시에 있는지 확인하고 없을 때만 메모리에서 읽어온다. 멀티 코어 프로세스에서는 다음과 같이 코어마다 별도의 캐시를 가지고 있기 때문에 원하는 결과를 얻지 못할 수도 있다. 🔍 Volatile 키..