본문 바로가기

728x90
반응형

힙꾸의 일상

(66)
[Architecture] 3-tier 레이어드 아키텍처의 한계를 마주하다 3-tier 아키텍처 시스템에서 데이터베이스가 변경되거나 다른 저장소를 추가해야 한다면? DB와 비즈니스 로직의 강결합으로 인한 문제가 발생한다.추상화 된 인터페이스가 없이 비즈니스 로직에서 직접적으로 MySQL 구현체를 사용한다.DIP 위반 - 고수준 모듈(Service)에서 저수준 모듈(Repository)에 의존한다.OCP 위반 - 확장에 열려있지 않으며, 저수준 모듈에서 수정 시 의존하는 고수준 모듈 역시 수정해야 하므로 수정에 닫혀있지도 않다.  MySQL DB에서 MongoDB로 변경비즈니스(서비스) 로직의 구현체를 MongoDB 구현체로 수정해야 한다.새로 MongoDB의 구현체로 만든 Repository에서 MongoDB에 맞는 데이터 처리 로직을 새로 구현해야 한다.public class..
[리마인드] 완전탐색(완탐, 브루트 포스) 코딩테스트 문제 오늘의 학습 키워드완전탐색완탐브루트 포스  다시풀기 문제1. 프로그래머스 Level 2 - 카펫https://school.programmers.co.kr/learn/courses/30/lessons/42842 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krGithub 풀이 Algorithm-Practice/프로그래머스/2/42842. 카펫 at main · dev-jinius/Algorithm-PracticeContribute to dev-jinius/Algorithm-Practice development by creating an account on GitHub.github.com  회고1. 프로그래머..
[리마인드] 힙(우선순위 큐) 코딩테스트 문제 오늘의 학습키워드힙우선순위 큐 다시풀기 문제1. 프로그래머스 Level 2 - 더 맵게https://school.programmers.co.kr/learn/courses/30/lessons/42626Github 풀이 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr Algorithm-Practice/프로그래머스/2/42626. 더 맵게 at main · dev-jinius/Algorithm-PracticeContribute to dev-jinius/Algorithm-Practice development by creating an account on GitHub.github.com 2. LeetCode Me..
[리마인드] 스택/큐 코딩테스트 문제 오늘의 학습 키워드스택, 큐 다시 풀기 문제1. 프로그래머스 Level 2 - 기능개발https://school.programmers.co.kr/learn/courses/30/lessons/42586Github 풀이보기 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr Algorithm-Practice/프로그래머스/2/42586. 기능개발 at main · dev-jinius/Algorithm-PracticeContribute to dev-jinius/Algorithm-Practice development by creating an account on GitHub.github.com 2. 프로그래머스 Le..
[LeetCode] 77. Combinations - 백트래킹 오늘의 학습 키워드백트래킹 알고리즘 문제LeetCode Medium - 77. Combinations  공부했던 내용Back Tracking특징가능한 모든 조합을 시도한다.조건을 만족하지 않으면 탐색을 중단하고, 이전 단계로 돌아가서 진행한다.핵심선택 -> 탐색 -> 선택 취소회고백트래킹의 재귀 호출과 재귀 종료 후 이전 단계로 돌아가는 부분이 헷갈렸다.선택 -> 재귀 호출로 모든 조합 탐색 -> 각 탐색 종료 시 선택 취소 => 이 부분을 정확히 이해해야 했다.문제 풀이import java.util.List;import java.util.ArrayList;class Solution { public void dfs(int start, int n, int k, List comb, List> resul..
[LeetCode] 70. Climbing Stairs - DP, 피보나치 수 오늘의 학습 키워드DP, 피보나치 수열 알고리즘 문제LeetCode - Easy70. Climbing Stairshttps://github.com/dev-jinius/Algorithm-Practice/tree/main/LeetCode/0070-climbing-stairs Algorithm-Practice/LeetCode/0070-climbing-stairs at main · dev-jinius/Algorithm-PracticeContribute to dev-jinius/Algorithm-Practice development by creating an account on GitHub.github.com  오늘의 회고1. 문제를 보고, 어떤 자료구조를 사용해서 어떻게 풀어야 할 지 생각이 들었나?2. 생각이..
[Leetcode] 오늘의 문제 - 2416. Sum of Prefix Scores of Strings 문제2416. Sum of Prefix Scores of Strings You are given an array words of size n consisting of non-empty strings.We define the score of a string word as the number of strings words[i] such that word is a prefix of words[i].For example, if words = ["a", "ab", "abc", "cab"], then the score of "ab" is 2, since "ab" is a prefix of both "ab" and "abc".Return an array answer of size n where answer[i] is..
[Leetcode] 오늘의 문제 - 214. Shortest Palindrome 문제214. Shortest PalindromeYou are given a string s. You can convert s to a palindrome by adding characters in front of it.Return the shortest palindrome you can find by performing this transformation.  키워드StringRolling HashString MatchingHash Function  내 첫번째 접근Deque 자료구조를 Stack처럼 사용해보려고 했다. 문자열 뒤집기StringBuilder의 reverse() 메서드로 문자열을 뒤집을 수 있다. 코드import java.lang.StringBuilder;class Solution { p..

728x90
반응형