일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- two pointers
- msa개념
- 자바
- coding test
- 밤비노
- jvm메모리구조
- DB
- sql
- servlet
- mysql
- 웹개발기초
- Bambino
- microservices
- jsp
- MSA
- 리액트프로젝트
- SpringFramework
- Java
- html
- 코드잇
- CSS
- 데이터베이스
- 웹개발
- Programming
- C
- MVC
- BCIT
- 안드로이드
- job
- 웹개발자
- Today
- Total
목록Coding Test (7)
초보 개발자의 기록
시간 복잡도- 입력 크기에 대해 어떠한 알고리즘이 실행되는 데 걸리는 시간- 로직의 반복 횟수를 중점으로 측정- 빅오 표기법으로 나타냄: 입력 범위 n을 기준으로 해서 로직이 몇 번 반복되는지 나타내는 것- 입력 크기가 커질수록 연산량이 가장 많이 커지는 항은 n의 제곱항이고, 다른 것은 그에 비해 미미하기 떄문에 이것만 신경 쓰면 된다는 이론- 효율적인 코드로 개선하는 데 쓰이는 척도 공간 복잡도- 프로그램을 실행시켰을 때 필요로 하는 자원 공간의 양- 정적 변수로 선언된 것 말고도 동적으로 재귀적인 함수로 인해 공간을 계속해서 필요로 할 경우도 포함 자료 구조에서의 시간 복잡도자료 구조의 평균 시간 복잡도자료 구조접근탐색삽입삭제배열 (array)O(1)O(n)O(n)O(n)스택(stack)O(n)O..
시간복잡도- 빅 오메가: 최선일 때의 연산 횟수를 나타낸 표기법- 빅 세타: 보통일 때의 연산 횟수를 나타낸 표기법- 빅 오: 최악일 때의 연산 횟수를 나타낸 표기법 * 코딩 테스트에서는 빅-오 표기법을 기준으로 수행 시간을 계산하는 것이 좋음시간 복잡도는 데이터 크기(N)의 증가에 따라 성능(수행 시간)이 다름 * 수행 시간은 1억 번의 연산을 1초의 시간으로 간주하여 예측* 시간 복잡도는 항상 최악일 때, 즉 데이터의 크기가 가장 클 때를 기준 * 연산 횟수 = 알고리즘 시간 복잡도 n값에 데이터의 최대 크기를 대입하여 도출* 데이터의 크기(N)을 단서로 사용해 알고리즘을 추측할 수 있음 시간 복잡도 도출 기준1. 상수는 시간 복잡도 계산에서 제외2. 가장 많이 중첩된 반복문의 수행 횟수가 시간 복잡..
Sort Colors problemStatementGiven an array, colors, which contains a combination of the following three elements:0 (representing red)1 (representing white)2 (representing blue)Sort the array in place so that the elements of the same color are adjacent, with the colors in the order of red, white, and blue. To improve your problem-solving skills, do not utilize the built-in sort function.Constrain..
Remove Nth Node from End of List ProblemStatementGiven a singly linked list, remove the n^th node from the end of the list and return its head.ConstraintsThe number of nodes in the list is k.1≤1≤ k ≤10^3−10^3≤ Node.data ≤10^31≤ n ≤ kApproaches1. Set two pointers, right and left, at the head of the linked list.2. Move the right pointer n steps forward.3. Move both the right and left pointers forw..
3Sum ProblemStatementGiven an integer array nums, find and return all unique triplets [nums[i], nums[j], nums[k]], where the indexes satisfy i≠j, i≠k, and j≠k, and the sum of the elements nums[i] + nums[j] + nums[k] == 0.Constraints3≤ nums.length ≤500−10^3≤ nums[i] ≤10^3Approaches* All numbers in the array are positive, so it is impossible to find any combination of three numbers that addes up t..
Valid Palindrome ProblemStatementWrite a function that takes a string, s, as an input and determines whether or not it is a palindrome. Constraints1≤1≤ s.length ≤2×10^5≤2×10^5The string s will not contain any white space and will only consist of ASCII characters(digits and letters).문자열 s의 길이가 최소 1에서 최대 200000까지 가능.문자열의 길이는 최소 1 이상이므로, 빈 문자열은 들어올 수 없음200,000까지 가능하므로, 시간 복잡도가 너무 크면 성능이 떨어질 수 있음O(n..
Two pointersVersatile techinique used in problem-solving to efficiently traverse or manipulate sequential data structures, such as arrays or linked lists.It involves maintaining two pointers that traverse the data structure in a coordinated manner, typically starting from different positions or moving in opposite directions. These pointers dynamically adjust based on specitic conditions or crite..