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