Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myBtree;
- import java.util.function.Consumer;
- import java.util.Optional;
- final public class Empty<T extends Comparable<T>> extends Btree<T> {
- public Empty() {}
- @Override
- public void display(Consumer<T> func) {}
- @Override
- public Btree<T> add(T data) {
- return new Node<T>(data, this, this);
- }
- @Override
- public Optional<Btree<T>> find(T data) {
- return Optional.empty();
- }
- @Override
- public boolean isEmpty() {
- return true;
- }
- @Override
- public Btree<T> remove(T data) {
- return this;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement