| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 프로그래머스
- shiba
- 밴픽
- Python Implementation
- kaggle
- attribute
- LeetCode
- t1
- 315. Count of Smaller Numbers After Self
- 운영체제
- Python
- 컴퓨터의 구조
- Protocol
- Decorator
- 시바견
- DWG
- 715. Range Module
- Python Code
- concurrency
- Convert Sorted List to Binary Search Tree
- Substring with Concatenation of All Words
- 30. Substring with Concatenation of All Words
- 109. Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- data science
- iterator
- Class
- Regular Expression
- 파이썬
- Generator
Archives
- Today
- Total
Scribbling
Python Set 자료형 본문
Set 자료형: 중복을 제거해준다.
mySet = set([1, 2, 3])
1) 데이터 추가
mySet.add(3)
mySet.update([4, 5, 6])
2) 데이터 삭제
mySet.remove(3): set에 3이 없으면 error
mySet.discard(3): set에 3이 없어도 no error
3) Set에 데이터 추가/삭제는 O(1)

'Computer Science > Algorithms & Data Structures' 카테고리의 다른 글
| 위상 정렬 (0) | 2021.08.14 |
|---|---|
| 신장 트리, 최소 신장 트리, Kruskal Algorithm (0) | 2021.08.13 |
| 무향/방향 그래프 내 Cycle 판별 (0) | 2021.08.12 |
| 서로소 집합 알고리즘 (0) | 2021.08.12 |
| 최단 거리 알고리즘 (0) | 2021.08.10 |