250x250
반응형
Recent Posts
Recent Comments
Link
«   2025/05   »
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
Archives
Today
Total
관리 메뉴

재 현

잡다한 것들 본문

Computer Science/Algorithm

잡다한 것들

본명은이점례 2020. 10. 30. 15:11
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