[Spring] 점프 투 스프링부트 - 2
2023. 7. 28. 02:01
Information Technology/Spring
Spring Boot Devtools 설치 HTML 삽입 미리보기할 수 없는 소스 - build.gradle 우클릭 > Refresh Gradle Project 클릭하여 필요한 라이브러리 다운로드 - Boot Dashboard에서 서버명이 nsbb > nsbb[devtools] 로 바뀌는 것 확인 롬복 설치 - https://projectlombok.org/download 로 가서 롬복 플러그인 다운로드 - 다운로드한 lombok.jar 파일을 STS 폴더에 넣고 롬복 파일 실행 - IDE 찾을 수 없다는 경고가 뜨면 [Specify location] 클릭 > STS 설치 경로 선택 - [Install / Update] 클릭하여 롬복 플러그인 설치 - [Quit Installer] 눌러 종료 HTML 삽..
[Algorithm] 토끼와 거북이 - 2
2023. 7. 28. 00:41
Information Technology/Algorithm
LeetCode 142번 문제 - Linked List Cycle 2 https://leetcode.com/problems/linked-list-cycle-ii/ 주어진 연결 리스트에서 사이클의 시작 노드 찾기 - 입력: 연결 리스트의 head - 출력: 사이클이 있으면 시작 노드, 없으면 null 리턴 - 토끼와 거북이 알고리즘으로는 만나는 거까진 알 수 있었는데 시작을 어디서 했는지는 모름 토끼와 거북이 알고리즘 2 - 시작 위치 찾기 토끼와 거북이는 같은 장소에서 출발 - 거북이가 한 칸을 이동할 동안, 토끼는 두 칸 이동 만약 연결 리스트 내에 사이클이 없다면 토끼와 거북이는 이동 중에 NULL 노드를 만날 것 만약 연결 리스트 내에 사이클이 있다면 토끼와 거북이는 언젠가 반드시 만나게 될 것 토..
[Algorithm] 토끼와 거북이 - 1
2023. 7. 26. 22:07
Information Technology/Algorithm
LeetCode 141번 문제 - Linked List Cycle https://leetcode.com/problems/linked-list-cycle/ - 입력: 연결 리스트의 head - 출력: 사이클이 있으면 true, 없으면 false를 리턴 - 공간을 O(1)만 사용하고 풀기 - 그냥 푸는 건 easy인데, O(1) 메모리를 사용해서 푸는 건 간단하지 않음 - 위키피디아의 Cycle detection (순환 검출) 을 참고하면 자세히 나와 있음 토끼와 거북이 알고리즘 1 - 사이클 유무 판단 - 토끼와 거북이는 같은 장소에서 출발 - 거북이가 한 칸을 이동할 동안, 토끼는 두 칸 이동 - 만약 연결 리스트 내에 사이클이 없다면 토끼와 거북이는 이동 중에 NULL 노드를 만날 것 - 만약 연결 리..
[Spring] 점프 투 스프링부트 - 1
2023. 7. 26. 01:41
Information Technology/Spring
환경 설정 java version 20.0.2 STS 4.19.0 프로젝트 이름: NSBB (Namani Spring Boot Board) 컨트롤러 - 서버에 전달된 클라이언트의 요청 (URL과 전달된 파라미터 등)을 처리하는 자바 클래스 // 클라이언트 (Client): 웹을 사용하는 고객 // 서버 (Server): HTTP 서버, HTML 파일들을 모아놓고 서비스하는 컴퓨터 @Controller - 해당 클래스가 컨트롤러의 기능을 수행함 - 이 애노테이션이 있어야 스프링부트 프레임워크가 컨트롤러로 인식 함 @GetMapping("hello") @Controller public class HelloController { @GetMapping("/hello") @ResponseBody public St..
[Spring] MVC 패턴이란?
2023. 5. 13. 19:58
Information Technology/Spring
MVC 패턴이란? - 일종의 역할 분담, 객체별 역할을 나누면, 보다 깔끔한 코드 작성 및 관리에 좋음 - 데이터는 모델 (Model) - 화면은 뷰 (View) - 처리는 컨트롤러 (Controller) 가 나누어 담당함 모델 (Model) - 어떠한 동작을 수행하는 코드 - 사용자에게 어떻게 보일지에 대해 신경쓰지 않아도 됨 - 순수하게 public 함수로만 이루어 짐 - 몇몇 함수들은 사용자의 질의 (query)에 대해 상태 정보를 제공하고, 나머지 함수들은 상태를 수정함 뷰 (View) - 모델은 여러 개의 뷰 (view)를 가질 수 있음 - 뷰는 보여줄 값(모델)을 컨트롤러로부터 받아와 사용자에게 보여줌 컨트롤러 (Contoller) - 뷰는 여러 개의 컨트롤러 (contoller)를 가지고 있..