| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- 투포인터
- 그리디
- boj
- 깃
- 자바
- 이진탐색
- two pointers
- 리트코드
- 코딩
- 방통대
- 컴퓨터과학과
- dynamic programming
- 탐욕알고리즘
- 백준
- 완전탐색
- greedy
- Binary Search
- 알고리즘
- 코테
- 방송통신대학교
- Git
- 방송대
- javascript
- it
- algorithm
- java
- LeetCode
- 자바스크립트
- sliding window
- DP
- Today
- Total
목록TwoPointers (2)
개발이 취미인 주니어 기획자
#투포인터 #EASY Move Zeroes - LeetCode Can you solve this real interview question? Move Zeroes - Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. E leetcode.com 🌷 문제 설명 ✏️ LeetCode 연습문제: Move Zeros Given an integer array nums, move all 0's to the end of it..
🚀 투포인터(Two Pointers)란? 정렬이 되어 있는 자료에서 두 포인터가 가리키는 값이 반환하는 값을 찾아내는 탐색 알고리즘. 타겟 값을 반환하는 한 쌍을 찾을 때까지 이진 검색을 순환적으로 반복 수행하며, 메모리와 시간 절약을 가져온다. 투포인터의 시간 복잡도는 O(N)이다. 🔎 투포인터 이해하기 1. Reverse Pointers ❓오름차순으로 정렬된 배열에서 두 수의 합이 타겟이 되는 값을 탐색해야 하는 상황일 때를 가정한다. 1. 포인터1(처음)과 포인터2(끝)를 정의한다 2. 포인터1과 포인터2의 합과 타겟 값을 비교한다 3-1. 포인터1과 포인터2의 합이 타겟값보다 작으면, 포인터1을 우측(+1)으로 옮긴다 3-2. 포인터1과 포인터2의 합이 타겟값보다 크면, 포인터2를 좌측(-1)으로..