Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package theMain;
- import myBtree.BtreeWrapper;
- import java.util.Optional;
- import java.util.function.Consumer;
- final public class Main {
- static public void main(final String[] args) {
- BtreeWrapper<Integer> me = BtreeWrapper.CreateEmpty();
- BtreeWrapper<String> you = BtreeWrapper.CreateEmpty();
- System.out.println(me);
- System.out.println(you);
- me
- .add(10)
- .add(1)
- .add(9)
- .add(2)
- .add(8)
- .add(3)
- .add(7)
- .add(4)
- .add(6)
- .add(5);
- BtreeWrapper<Integer> orig = me.getBtreeWrapper();
- me.display(System.out::println);
- System.out.println("-->\n\n");
- me
- .remove(10)
- .remove(8)
- .remove(6)
- .remove(4)
- .remove(2)
- .display(System.out::println);
- System.out.println("<--\n\n");
- you
- .add("salty")
- .add("was")
- .add("dounut")
- .add("here")
- .add("again");
- you.display(System.out::println);
- me.find(7).ifPresent(p -> p.display(System.out::println));
- System.out.println("\n\n");
- me.display(System.out::println);
- System.out.println("\n\norig\n\n");
- orig.display(System.out::println);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement