본문 바로가기

전체 글

(56)
예제로 배우는 알고리즘 - 비트 마스킹 이진수 더하기 예제 - LeetCode 67. Add Binaryhttps://leetcode.com/problems/add-binary/description/?envType=study-plan-v2&envId=top-interview-150 1. 문제 이해 문자열로 주어진 두 이진수를 더한 값을 이진 문자열로 나타내기 2. 요구사항 분석입력1각 문자열의 요소는 0 또는 10을 제외하고는 0으로 시작하지 않음출력이진 문자열 3. 해결 아이디어가장 낮은 자리부터 더해가기더한 값을 2로 나누어 몫은 올림값에 나머지는 결과에 저장하기낮은 자리부터 더했으므로 뒤집은 값을 반환 4. 시간 복잡도 및 공간 복잡도 확인 시간 복잡도자릿수를 하나씩 확인하므로 O(n)공간 복잡도결과를 저장할 StringBuilder가 ..
예제로 배우는 알고리즘 - 수학 숫자 뒤집기 예제 - LeetCode 9. Palindrome Numberhttps://leetcode.com/problems/palindrome-number/description/?envType=study-plan-v2&envId=top-interview-150 1. 문제 이해 팰린드롬(앞에서부터 읽어도 뒤에서부터 읽어도 같은 수) 찾기 2. 요구사항 분석입력x : int 범위출력true : 펠린드롬 Ofalse : 펠린드롬 X 3. 해결 아이디어음수는 -기호로 인해 펠린드롬이 아님수학적 뒤집기 : 입력 값을 뒤집은 값을 구하고 입력 값과 뒤집은 값이 같으면 펠린드롬문자열 + 투포인터 : 문자열로 변환 후 투포인터로 앞, 뒤를비교하며 달라지면 펠린드롬이 아님 4. 시간 복잡도 및 공간 복잡도 확인 시간..
Guide - 폼 입력 검증 https://spring.io/guides/gs/validating-form-input Getting Started | Validating Form InputThe application involves validating a user’s name and age, so you first need to create a class that backs the form used to create a person. The following listing (from src/main/java/com/example/validatingforminput/PersonForm.java) shows how to do so: pacspring.io 목표 표준 검증 애너테이션을 활용한 입력값 검증 응답 : 오류 메세지 표시(사용자..
관계형 모델 관계형 데이터베이스의 구조 관계형 데이터베이스 : 릴레이션의 모임릴레이션(테이블) : 관련있는 데이터의 모임instructor는 교수 데이터의 모임속성(테이블의 열) : 저장할 데이터가 공통적으로 가지는 특성각 교수 데이터는 ID, 이름, 학과명, 급여의 속성을 가짐튜플(테이블의 행) : 한 개의 데이터(레코드)ID가 1, 이름이 Yang, 학과가 Biology, 급여가 40000인 한 개의 교수 데이터가 있음데이터베이스 스키마 릴레이션 스키마 : 릴레이션의 구조 정의(논리적 설계)릴레이션 인스턴스 : 릴레이션에 저장된 실제 데이터 집합String str = "Hello"; String은 해당 변수에 들어가는 값의 구조를 정의하고 Hello는 이 구조에 맞는 실제 값입니다릴레이션 스키마는 프로그래밍 언어..
예제로 배우는 알고리즘 - 투 포인터 투 포인터 기본 개념 투 포인터 : 두 개의 포인터를 사용하여 배열을 탐색하는 알고리즘포인터 : 데이터가 저장된 메모리 주소를 가리키는 변수 예제 1 - LeetCode 125. Vaild Palindromehttps://leetcode.com/problems/valid-palindrome/description/?envType=study-plan-v2&envId=top-interview-150 1개의 포인터는 반복문에서 많이 사용했을 것입니다String s = "race a car";for (int i = 0; i   거꾸로 읽어도 원래의 문자열과 동일한 회문은 투 포인터를 활용하면 쉽게 해결할 수 있습니다* 문자열은 문자형의 배열 앞에서 읽어도 뒤에서 읽어도 같아야 하기 때문에 left는 1씩 증가하고..
Guide - 폼 제출 처리 https://spring.io/guides/gs/handling-form-submission Getting Started | Handling Form SubmissionAlthough you can package this service as a traditional WAR file for deployment to an external application server, the simpler approach is to create a standalone application. You package everything in a single, executable JAR file, driven by a good old Javaspring.io 목표URL로 접근할 수 있는 웹 폼 구축 및 결과 페이지 반환요청 ..
Guide - Spring MVC를 사용하여 웹 콘텐츠 제공하기 https://spring.io/guides/gs/serving-web-content Getting Started | Serving Web Content with Spring MVCStatic resources, including HTML and JavaScript and CSS, can be served from your Spring Boot application by dropping them into the right place in the source code. By default, Spring Boot serves static content from resources in the classpath at /static (orspring.io 목표URL 요청 시 HTML을 포함한 웹 페이지가 반환 요..
Guide - RESTful 웹 서비스 소비 https://spring.io/guides/gs/consuming-rest Getting Started | Consuming a RESTful Web ServiceYou can run the application from the command line with Gradle or Maven. You can also build a single executable JAR file that contains all the necessary dependencies, classes, and resources and run that. Building an executable jar makes it easy to ship, verspring.io 목표 브라우저 또는 curl을 활용한 URL 요청이 아닌 RestTemp..