전체 글
-
[Java] Java Collection Framework의 모든것을 알아보자Java/자바를 더 깊게 2022. 2. 22. 17:29
Java Collection Framework(JCF)란? Collection이란 객체 그룹을 나타내는 객체입니다. Collection 에 기본형 int를 넣지 못하고 객체인 Integer를 넣는 것을 떠올리시면 됩니다. 컬렉션 프레임워크는 컬렉션을 표현하고 조작하기 위한 통합 아키텍처로, 세부 구현 사항과 독립적으로 컬렉션을 조작할 수 있습니다. 데이터를 저장하는 자료 구조와 데이터를 처리하는 알고리즘을 구조화하여 클래스로 구현해 놓은 것으로 생각하시면 됩니다. Framework vs Library 둘 다 개발 생산성을 증가시켜준다는 공통점이 존재하지만 제어를 누가 할 수 있느냐에 따른 차이점이 있습니다. 라이브러리는 개발자가 라이브러리를 제어할 수 있으며, 프레임워크는 프레임워크가 개발자를 제어합니다..
-
1873. 상호의 배틀필드 - 자바(JAVA)알고리즘/SW Expert Academy 2022. 2. 22. 00:01
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5LyE7KD2ADFAXc SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 문제 해석 전차는 하나만 존재한다. 사용자의 전차는 사용자의 입력에 따라 격자판으로 이루어진 게임 맵에서 다양한 동작을 한다. 다음 표는 게임 맵의 구성 요소를 나타낸다. 문자 의미 . 평지(전차가 들어갈 수 있다.) * 벽돌로 만들어진 벽 # 강철로 만들어진 벽 - 물(전차는 들어갈 수 없다.) ^ 위쪽을 바라보는 전차(아래는 평지이다.) v 아래쪽을 바라보는 전차(아래는 평지이다.) 오른쪽을 바..
-
1954. 달팽이 숫자 - 자바(JAVA)알고리즘/SW Expert Academy 2022. 2. 21. 00:01
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PobmqAPoDFAUq SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 문제 해석 N이라는 크기가 입력되면 N x N 크기의 배열을 만들고 거기에 오른쪽, 아래, 왼쪽, 위를 기준으로 달팽이 모양을 그리면서 숫자를 증가시키면서 채워 넣습니다. N=4인 경우 N=3인 경우 입력 가장 첫 줄에는 테스트 케이스의 개수 T가 주어지고, 그 T개의 N이 주어진다. 제약 조건 1
-
[백준] 17478번 : 재귀함수가 뭔가요? - 자바(JAVA)알고리즘/백준 2022. 2. 20. 00:01
https://www.acmicpc.net/problem/17478 17478번: 재귀함수가 뭔가요? 평소에 질문을 잘 받아주기로 유명한 중앙대학교의 JH 교수님은 학생들로부터 재귀함수가 무엇인지에 대하여 많은 질문을 받아왔다. 매번 질문을 잘 받아주셨던 JH 교수님이지만 그는 중앙대 www.acmicpc.net 문제 해석 재귀 함수를 어떻게 활용할 수 있는지에 대한 문제입니다. 문제 풀이 전 설계 "를 출력하기 위해서는 \"를 사용해야 한다. 출력이 많으므로 StringBuilder에 쌓아서 한 번에 출력한다. 재귀 함수 호출하기 전에 실행해야 하는 구문들 "재귀 함수가 뭔가요?" "잘 들어보게.~" "마을 사람들은~" "그의 답은~" 재귀 함수를 호출한 후에 실행해야 하는 구문들 "라고 답변하였지."..
-
[Java] DTO, DAO, VO란?Java 2022. 2. 19. 00:01
자바를 공부하던 중 DTO, DAO라는 단어들이 많이 보여서 확실하게 개념을 잡고 가고자 정리하게 되었습니다. DAO란? Data Access Object의 약자로, 데이터베이스의 data에 접근하기 위한 객체입니다. 데이터베이스에 접근하기 때문에 Service와 DB를 연결하는 고리의 역할을 합니다. jdbc와 같은 곳에서 db connection을 받아오거나, DB와 서로 통신하는 기능을 담당하는 객체를 뜻합니다. 아래의 코드는 DAO 클래스의 예제입니다. jdbc쪽 안 써보셨다면 이해가 어려울 수 있지만 단순히 DB와 연결하여 통신(조회, 삭제, 수정)할 수 있는 객체입니다. 코드를 보시면 List를 반환하네요? MemberDto라는 객체의 리스트를 반환하는데 DTO란 무엇인지는 아래에서 살펴보겠습..
-
1289. 원재의 메모리 복구하기 - 자바(JAVA)알고리즘/SW Expert Academy 2022. 2. 18. 00:01
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV19AcoKI9sCFAZN SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 문제 해석 메모리 초기값은 000000으로 0으로 이루어진 값들로 이루어집니다. 3번째 값에 1을 채우면 해당 값이 끝까지 덮어씌워집니다.(ex 000111) 만약 왼쪽부터 2번째값에 1을 채우면 011111으로 덮어씌워집니다. 여기서 왼쪽에서 4번째 값에 0을 채우면 011000으로 덮어씌워집니다. 이때 모든 bit가 0인 상태에서 원래 상태로 돌아가는데 최소 몇 번이나 고쳐야 하는지 찾아보자. ..
-
[Java] JVM이란? JVM(Java Virtual Machine)의 모든것을 알아보자Java/자바를 더 깊게 2022. 2. 17. 09:06
JVM이란? Java Virtual Machine의 약자로 자바 가상 머신이라고 불립니다. 자바와 운영체제 사이에서 중계자 역할을 합니다. 따라서 자바가 운영체제 종류에 영향받지 않고 돌아갈 수 있도록 합니다. = (Write Once Run AnyWhere) C언어나 C++언어 같은 경우에는 16비트, 32비트, 64비트 플랫폼에 따라 int 형의 크기가 변하지만 JVM은 기본 자료형인 int는 4바이트(2^32)로 고정시켜 타입의 안정성을 꾀하고 플랫폼 독립성을 보장합니다. 어떤것들은 JVM이라고 부를 수 있을까? (JVM Specification) Specification은 '규격' 또는 '사양'이라고 번역됩니다. 특정 기술분야에 대해, 이 기술은 이런 규격을 가졌으니 이 기술을 사용하거나 구현할 ..
-
[백준] 3085번 : 사탕 게임 - 자바(JAVA)알고리즘/백준 2022. 2. 17. 00:01
https://www.acmicpc.net/problem/3085 3085번: 사탕 게임 예제 3의 경우 4번 행의 Y와 C를 바꾸면 사탕 네 개를 먹을 수 있다. www.acmicpc.net 문제 해석 N x N 크기에 사탕이 채워져 있다. 사탕의 색은 같지 않을 수 있다. 사탕의 색이 다른 인접한 두 칸을 골라서 교환할 수 있다. 교환은 단 한 번만 이루어진다. 이때 사탕이 같은 색인 가장 긴 연속 부분을 출력한다. 입력 첫째 줄에 보드의 크기 N이 주어진다. 다음 N개의 줄에는 보드에 채워져 있는 사탕의 색상이 주어진다. 제약조건 3 tempMax ? maxCandyCount : tempMax; tempMax = 1; } } maxCandyCount = maxCandyCount > tempMax ?..