전체 글 131

Week 1-1. [Array / String] 122. Best Time to Buy and Sell Stock II

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ Best Time to Buy and Sell Stock II - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock II - You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can onl..

💫 ETC/Leetcode 2023.08.24

Week 1-1. [Array / String] 121. Best Time to Buy and Sell Stock

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/best-time-to-buy-and-sell-stock/?envType=study-plan-v2&envId=top-interview-150 Best Time to Buy and Sell Stock - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock - You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choo..

💫 ETC/Leetcode 2023.08.24

Week 1-1. [Array / String] 189. Rotate Array

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/rotate-array/?envType=study-plan-v2&envId=top-interview-150 Rotate Array - LeetCode Can you solve this real interview question? Rotate Array - Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1..

💫 ETC/Leetcode 2023.08.24

JVM GC의 처리 과정

GC(Garbage Collector)란? 여기서 말하는 Garbage란, 동적으로 할당했던 메모리 중 필요없게 된 메모리 객체를 뜻한다. 따라서 Garbage Collector를 한 단어로 표현하자면 "쓰레기 객체 정리자" 정도로 표현할 수 있다. GC 대상 GC는 Heap 영역을 대상으로 한다. GC의 처리 과정을 보기 위해서, Heap 영역에 대해 살펴보자. Heap은 처음 설계될 때 2가지 전제로 설계되었다. 1. 대부분의 객체는 금방 접근 불가능한 상태(Unreachable)가 된다. 2. 오래된 객체에서 새로운 객체로의 참조는 아주 적게 존재한다. 즉, 객체는 대부분 일회성이며 메모리에 오랫동안 남아있는 경우는 드물다는 것이다. 이러한 특성을 이용해 JVM 개발자들은 보다 효율적인 메모리 관리..

Java 애플리케이션의 실행 과정과 JVM의 구조

JVM이란?JVM(Java Virtual Machine)이란 자바 가상 머신, 즉 Java 프로그램을 싱행하는 가상의 컴퓨터이다.(가상머신이란 프로그램을 실행하기 위한 물리적 머신과 유사한 머신을 소프트웨어로 구현한 것이다.) JVM의 역할은 자바 애플리케이션을 클래스 로더를 통해 읽어들여 실행하는 것이다.또한 JVM은 Java와 OS 사이에서 중개자 역할을 수행하여 특정한 하드웨어나 OS에 의존하지 않고 Java 코드를 실행할 수 있게 해준다. 그리고 가장 중요한, 메모리 관리(GC)를 수행한다. 왜 JVM을 알아야 하는가한정된 시스템 리소스 중에서 가장 중요한 것은 메모리이다.동일한 기능의 프로그램이더라도 메모리 관리에 따라 성능이 좌우된다. (프로그램이 메모리를 효율적으로 사용하지 않으면 성능 저하..

Week 1-1. [Array / String] 169. Majority Element

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/majority-element/?envType=study-plan-v2&envId=top-interview-150 Majority Element - LeetCode Can you solve this real interview question? Majority Element - Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element al..

💫 ETC/Leetcode 2023.08.23

Week 1-1. [Array / String] 80. Remove Duplicates from Sorted Array II

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/?envType=study-plan-v2&envId=top-interview-150 Remove Duplicates from Sorted Array II - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted Array II - Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place [https://en.wikiped..

💫 ETC/Leetcode 2023.08.23

Week 1-1. [Array / String] 26. Remove Duplicates from Sorted Array

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/remove-duplicates-from-sorted-array/?envType=study-plan-v2&envId=top-interview-150 Remove Duplicates from Sorted Array - LeetCode Can you solve this real interview question? Remove Duplicates from Sorted Array - Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place [https://en.wikipedia.org/wik..

💫 ETC/Leetcode 2023.08.23

Week 1-1. [Array / String] 27. Remove Element

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/remove-element/?envType=study-plan-v2&envId=top-interview-150 Remove Element - LeetCode Can you solve this real interview question? Remove Element - Given an integer array nums and an integer val, remove all occurrences of val in nums in-place [https://en.wikipedia.org/wiki/In-place_algorithm]. The order of the elements may be cha..

💫 ETC/Leetcode 2023.08.23

Week 1-1. [Array / String] 88. Merge Sorted Array

문제 해결 과정 ✍️ 나만의 방식으로 문제 정리하기 (=체계화) https://leetcode.com/problems/merge-sorted-array/?envType=study-plan-v2&envId=top-interview-150 Merge Sorted Array - LeetCode Can you solve this real interview question? Merge Sorted Array - You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respecti..

💫 ETC/Leetcode 2023.08.23