Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- torchserve
- FDS
- NLP
- wandb
- Kaggle
- pytorch
- leetcode
- DeepLearning
- vscode
- docker
- github
- Matplotlib
- Kubernetes
- 완전탐색
- PytorchLightning
- rnn
- 알고리즘
- 코딩테스트
- 네이버AItech
- pep8
- GitHub Action
- FastAPI
- 프로그래머스
- autoencoder
- datascience
- NaverAItech
- python
- GIT
- 백준
- GCP
Archives
- Today
- Total
Sangmun
python queue 구현 본문
class Queue:
def __init__(self):
self.arr=[]
def push(self,a):
self.arr.append(a)
def pop(self):
del self.arr[0]
def size(self):
return len(self.arr)
def top(self):
return self.arr[-1]
def siz(self): #size는 다른 함수로 이미 사용되고 있기 때문에 사용 불가...
return len(self.arr)
큐 대표 문제
https://www.acmicpc.net/problem/5430
5430번: AC
각 테스트 케이스에 대해서, 입력으로 주어진 정수 배열에 함수를 수행한 결과를 출력한다. 만약, 에러가 발생한 경우에는 error를 출력한다.
www.acmicpc.net
'알고리즘 > 알고리즘(초급)' 카테고리의 다른 글
배낭 문제(냅색 문제) - 2(분할 불가능한 냅색 문제) (0) | 2022.12.20 |
---|---|
배낭 문제(냅색 문제) - 1 (분할가능한 배낭 문제) (0) | 2022.12.20 |
python 으로 stack 직접 구현하기 (0) | 2022.12.04 |
투포인터 (0) | 2022.11.23 |
백트래킹을 이용한 부분 집합을 구하는 알고리즘 (0) | 2022.11.21 |
Comments