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 |
Tags
- 미분 방정식
- 델
- 선적분
- 딥러닝
- dictionary
- auto-encoder
- 자료형
- 2P1L
- Class
- java
- 최단 경로
- 계단 오르기
- Python
- cURL
- 딕셔너리
- 벡터 해석
- 회로이론
- 강화학습
- 자바
- Asteroid RL
- 파이썬
- 벡터해석
- 피보나치 수열
- BST
- 이진탐색트리
- 코드업
- 소행성
- 백트래킹
- 신경망
- 함수
Archives
- Today
- Total
Zeta Oph's Study
[Data Structure (Java)] Set 본문
https://crane206265.tistory.com/88
[Data Structure (Java)] Hash (Separate Chaining & Linear Probing)
https://crane206265.tistory.com/87 [Data Structure (Java)] Map ADThttps://crane206265.tistory.com/86 [Data Structure (Java)] Heapsorthttps://crane206265.tistory.com/85 [Data Structure (Java)] Heaphttps://crane206265.tistory.com/84 [Data Structure (Java
crane206265.tistory.com
이번에는 Set입니다. 사실 Hash랑 Map이 재밌긴 했지만 실제로는 Set을 더 많이 쓸거 같은 이 기분..
Set ADT
: an unordered collection of distinct keys
- elements of a set : unique keys of a map without any associated values
Set API
API of Set(data type of element : E)
methods | explanation |
int size() | return # of elements in the set |
boolean isEmpty() | return if the set is empty |
boolean add(E e) | add the given element e to the set, return if the set changed |
boolean remove(E e) | remove the given element e from the set, return if the set changed |
boolean contains(E e) | return if the given element e is in set |
Java's Set Operations (operations above is also implemented)
methods | explanation |
boolean addAll(Collection<E> c) | add all elements from the given collection c to the set, return if the set changed |
boolean containsAll(Collection<E> c) | return if all elements from the given collection c is in the set |
boolean removeAll(Collection<E> c) | remove all elements from the given collection c from the set return if the set changed |
boolean retainAll(Collection<E> c) | remove elements not found in the given collection c from the set return if the set changed |
boolean equals(Set<E> s) | return if the given set s and this set is equal |
Iterator<> iterator() | return the iterator over the elements in the set |
Object[] toArray() | return the array over the elements in the set |
Set Implementation
in java.util package
1. java.util.HashSet : unordered set implementation with a hash table
2. java.util.LinkedHashSet : set implementation with a hash table (in insertion order)
3. java.util.TreeSet : sorted set implementation with a binary tree
'프로그래밍 > Java' 카테고리의 다른 글
[Data Structure (Java)] Tree (5) - AVL Tree (2) | 2024.06.09 |
---|---|
[Data Structrue (Java)] Tree (4) - Binary Search Tree Map (1) | 2024.06.06 |
[Data Structure (Java)] Hash (Separate Chaining & Linear Probing) (1) | 2024.06.05 |
[Data Structure (Java)] Map (1) | 2024.06.03 |
[Data Structure (Java)] Heapsort (2) | 2024.06.03 |