-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTreeSet_.java
More file actions
27 lines (19 loc) · 1.05 KB
/
TreeSet_.java
File metadata and controls
27 lines (19 loc) · 1.05 KB
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
package Java_Basic;
import java.util.TreeSet;
public class TreeSet_ {
public static void main(String[] args) {
/*
https://www.geeksforgeeks.org/treeset-in-java-with-examples/
addAll(Collection c)
floor() <= ele <= ceiling()
lower() < ele < higher()
ceiling?(E e) This method returns the least element in this set greater than or equal to the given element, or null if there is no such element.
floor?(E e) This method returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
higher?(E e) This method returns the least element in this set strictly greater than the given element, or null if there is no such element.
lower?(E e) This method returns the greatest element in this set strictly less than the given element, or null if there is no such element.
first() return the 1st element
last() return the last element
*/
TreeSet<Integer> set = new TreeSet<>();
}
}