재 현
잡다한 것들 본문
728x90
from collections import deque
deque 모듈 ( 큐를 구현할 때 쓰인다)
.append()
.appendleft()
.clear()
.count(x)
.insert(i,x)
.pop()
.popleft()
.remove(value)
.reverse()
.rotate(n=1) // n만큼 모든 원소를 오른쪽으로 이동
list to string
" ".join(list)
선형 큐 vs 원형 큐
선형 큐 : append, popleft
원형 큐 : popNum = (popNum + (k-1)) % len(d) => 백준 1158번 문제
파이썬 문자열 입력 시간 줄이는 법
from sys import stdin
for _ in range(int(stdin.readline())
arr = stdin.readline()
*ssafy, bob, 소마, 42Seoul, 배민캠프, 소멤
728x90
'Computer Science > Algorithm' 카테고리의 다른 글
DFS (0) | 2020.11.02 |
---|---|
알고리즘 공부법 (0) | 2020.10.30 |
구현 ( Implementation) (0) | 2020.10.30 |
그리디 : 가장 최적의 해 (0) | 2020.10.30 |
import collections (0) | 2020.10.30 |