github.com/taemin-kwon93 Github 보러가기 ->

2024/07 15

JAVA 자료형, 컬렉션 프레임 워크 설명 메모

자바 알고리즘 인터뷰 책을 보며 학습한 내용. 자바는 어떤 자료형을 제공하는가?자바의 자료형은 크게 원시 자료형(Primitive Data Type)과 원시가 아닌 자료형(Non-Primitive Data Type)으로 구분할 수 있다. Non-Primitive data type 은 데이터가 저장되는 위치를 참조한다 하여, 참조 자료형 Reference data type이라고도 한다. 자바에서는 클래스 형태로 되어 있다. 원시 자료형byte, short, int, long, float, double, boolean, char 1 byte = 8 bit, bit 수 만큼의 제곱byte1 바이트-128 ~ 127 (-2^7 ~ 2^7 - 1)short2 바이트-32,768 ~ 32,767 (-2^15 ~ 2..

기수 변환

자료구조와 함께 배우는 알고리즘 입문 책을 보며 학습한 내용. 기수 변환하기10진수 정수를 n진수 정수로 변환하려면 정수를 n으로 나눈 나머지를 구하고,그 몫을 n으로 나누는 과정을 반복해야 합니다.이 과정을 몫이 0이 될 때까지 반복하고, 이런 과정을 통해 구한 나머지를 거꾸로 나열한 숫자가 기수로 변환한 숫자입니다.10진수 59를 2진수로 변환하는 과정111011을 10진수로 다시 변환하려면, 각 자리에 2의 제곱수를 구한다음 모두 더하면 된다.1 + 2 + 0*(2^2) + 1(2^3) + 1(2^4) + 1(2^5) + 1(2^6) 8진수0 1 2 3 4 5 6 7 로 이루어진 여덟개의 숫자를 사용하여 수를 표현이숫자를 모두 사용하면 자릿수가 한 자리 올라가 10이 됨그 다음 수는 11 ~17, ..

LeetCode 스택과 큐 225. Implement Stack using Queues, 232. Implement Queue using Stacks

문제에 대한 설명은 링크로 대체 225. Implement Stack using Queueshttps://leetcode.com/problems/implement-stack-using-queues/description/ 232. Implement Queue using Stackshttps://leetcode.com/problems/implement-queue-using-stacks/description/  스택(Stack)과 큐(Queue)는 프로그래밍의 시작 부터 사용된 고전적인 자료구조 중 하나다.스택은 LIFO(Last-in-first-out, 후입선출), 큐는 FIFO(First-in-first-out, 선입선출)로 처리된다.  스택은 접시를 쌓고 꺼내는 것과 유사하다.3개의 접시를 선반에 저장할..

LeetCode 739.Daily Temperatures

문제설명: Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead. 매일의 온도 리스트 'temperatures' 를 입력받아 더 따뜻한 날씨가 되기까지 며칠 기다려야 하는지 출력. Example 1:Input: temperatures = [73,74,75..

LeetCode 316.Remove Duplicate Letters

문제 설명:Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your result is the smallest in lexicographical order  among all possible results. Example 1:Intput: s = "bcabc"Output: "abc" Example 2:Intput: s = "cbacdcbc"Output: "acdb"  풀이:class Solution { public String removeDuplicateLetters(String s) { // s의 글자 총 갯수를 세는 용도의 변수 ..