| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 715. Range Module
- Decorator
- DWG
- data science
- 109. Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
- 파이썬
- Regular Expression
- concurrency
- shiba
- Class
- Generator
- 시바견
- Python Implementation
- Protocol
- LeetCode
- Convert Sorted List to Binary Search Tree
- 프로그래머스
- iterator
- t1
- 43. Multiply Strings
- kaggle
- Python
- 315. Count of Smaller Numbers After Self
- 컴퓨터의 구조
- 밴픽
- Substring with Concatenation of All Words
- Python Code
- 운영체제
- attribute
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 |