반응형

분류 전체보기 388

[스프링 퀵스타트] Day1 - chapter2. 프레임워크 개요 (v2023)

2.1.3 자바 기반의 프레임워크 처리 영역프레임워크 PresentationStrutsStruts 프레임워크는 UI Layer에 중점을 두고 개발된 MVC(Model View Controller) 프레임워크이다.Spring(MVC)Struts와 동일하게 MVC 아키텍처를 제공하는 UI Layer 프레임워크이 다. 하지만 Struts처럼 독립된 프레임워크는 아니고 Spring 프레임워크 에 포함되어 있다. BusinessSpring(IoC, AOP)Spring은 컨테이너 성격을 가지는 프레임워크이다. Spring의 IoC와 AOP 모듈을 이용하여 Spring 컨테이너에서 동작하는 엔터프라이즈 비 즈니스 컴포넌트를 개발할 수 있다.PersistenceHibernateorJPAHibernate는 완벽한 ORM..

[헤드퍼스트 디자인패턴] chapter8. 템플릿 메소드 패턴 (템플릿 메소드패턴, 할리우드원칙)

템플릿 메소드 패턴 1. 정의 - 알고리즘의 골격을 정의 - 템플릿 메소드를 사용하면 알고리즘의 일부 단계를 서브 클래스에서 구현할 수 있으며, 알고리즘의 구조는 그대로 유지하면서 알고리즘의 특정 단계를 서브클래스에서 재정의 가능 할리우드 원칙 (hollywood principle) 1. 정의 - 저수준 구성 요소가 시스템에 접속할 수는 있지만 언제 어떻게 그 구성 요소를 사용할지는 고수준 구성 요소가 결정한다. - 즉, 고수준 구성 요소가 저수준 구성 요소에게 '먼저 연락하지 마세요. 제가 먼저 연락드리겠습니다'와 동일하다. 2. 할리우드 원칙 vs 의존성 뒤집기 원칙 - 의존성 뒤집기 원칙 : 될 수 있으면 구상 클래스 사용 줄이고 추상화된 것 사용해야 한다는 원칙 - 할리우드 원칙 : 저수준 구성 ..

꿀팁 2023.11.14

[헤드퍼스트 디자인패턴] chapter7.어댑터 패턴과 퍼사드 패턴 (어댑터 패턴, 퍼사드 패턴, 최소 지식 원칙, 데메테르 법칙)

어댑터 패턴 1.정의 - 특정 클래스 인터페이스를 클라이언트에서 요구하는 다른 인터페이스로 변환한다. 인터페이스가 호환되지 않아 같이 쓸 수 없었던 클래스를 사용할 수 있게 도와준다. 2. 특징 - 객체 어댑터와 클래스 어댑터가 있다. 퍼사드 패턴 1. 정의 - 서브시스템에 있는 일련의 인터페이스를 통합 인터페이스로 묶어준다. 또한 고수준 인터페이스도 정의하므로 서브시스템을 더 편리하게 사용할 수 있다. cf) 데코레이터 vs 어댑터 vs 퍼사드 - 데코레이터 : 인터페이스는 바꾸지 않고 책임(기능)만 추가 - 어댑터 : 하나의 인터페이스를 다른 인터페이스로 변환 - 퍼사드 : 인터페이스를 간단하게 변경 최소 지식 원칙 (principle of least knowlege) = 데메테르의 법칙과도 동일한 ..

꿀팁 2023.11.13

[leetcode][Medium][Stack] 739. Daily Temperatures 풀이, 해설 (python)

https://leetcode.com/problems/daily-temperatures/ Daily Temperatures - LeetCode Can you solve this real interview question? 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 leetcode.com 1차 풀이 class Solution(object): def dailyTemperatur..

🤖 알고리즘 2023.11.12

[leetcode][Medium][Stack] 22. Generate Parentheses 힌트, 풀이, 해설 (python)

https://leetcode.com/problems/generate-parentheses/ Generate Parentheses - LeetCode Can you solve this real interview question? Generate Parentheses - Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Exa leetcode.com 힌트 https://www.youtube.com/watch?v=s9fokUqJ76A ..

🤖 알고리즘 2023.11.11

[leetcode][Medium][Stack] 150. Evaluate Reverse Polish Notation 풀이, 해설 (python)

https://leetcode.com/problems/evaluate-reverse-polish-notation/ Evaluate Reverse Polish Notation - LeetCode Can you solve this real interview question? Evaluate Reverse Polish Notation - You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation [http://en.wikipedia.org/wiki/Reverse_Polish_notation]. Evaluate t leetcode.com 1차 풀이 class Solution..

🤖 알고리즘 2023.11.07

[leetcode][Medium][Stack] 155. Min Stack 풀이, 해설 (python)

https://leetcode.com/problems/min-stack/ Min Stack - LeetCode Can you solve this real interview question? Min Stack - Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: * MinStack() initializes the stack object. * void push(int val) pushes t leetcode.com 1차 풀이 가벼운 스택 문제일거라 생각했는데, getMin 부분에서 어떻게 O(1)을 만들까 잠깐 고민했다. 그러다가 ..

🤖 알고리즘 2023.11.06

[leetcode][Easy][Stack] 20. Valid Parentheses 풀이, 해설 (python)

https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Can you solve this real interview question? Valid Parentheses - Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 1. Open brackets must be closed by the sam leetcode.com 1차 풀이 단순한 스택 문제라 간단히 풀었지만, 조건이 추가가 되면서 좀 복잡한 풀이가 되..

🤖 알고리즘 2023.11.03

[leetcode][Hard][Two Pointers] 42. Trapping Rain Water 풀이, 해설 (python) : 해설 참고해서 푼 풀이

https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Can you solve this real interview question? Trapping Rain Water - Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: [https://assets.leetcode.com/upl leetcode.com 한시간 정도 풀릴까 말까 하다가, 풀리지 않아서 ... 결국 해설을 본 풀이이다. 일단,..

🤖 알고리즘 2023.10.29

[leetcode][Medium][Two Pointers] 11. Container With Most Water 풀이, 해설 (python)

https://leetcode.com/problems/container-with-most-water/ Container With Most Water - LeetCode Can you solve this real interview question? Container With Most Water - You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that toget leetcode.com 1차 풀이 일단 단순하게, O(n^2)로 접근했다. 그랬더니 ..

🤖 알고리즘 2023.10.29
반응형