Skip to content
29 changes: 29 additions & 0 deletions src/MultiSet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import jdk.jshell.spi.ExecutionControl;
public class MultiSet {

public static void add() throws Exception {
throw new Exception("Exception message");
}

public static void remove() throws Exception {
throw new Exception("Exception message");
}

public static void contains() throws Exception {
throw new Exception("Exception message");
}

public static void is_empty() throws Exception {
throw new Exception("Exception message");
}
public static void count() throws Exception {
throw new Exception("Exception message");

}

public static void size() throws Exception {
throw new Exception("Exception message");

}

}
25 changes: 24 additions & 1 deletion src/Tree.java
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
import java.util.ArrayList;
import java.lang.Object;

public class Tree {
}

//root of the tree
private Object root;
// list of all subtrees
private ArrayList<Tree> subtrees;

public Tree(Object root, ArrayList<Tree> subtrees){
this.root = root;
this.subtrees = subtrees;
if (subtrees.isEmpty()){
this.subtrees = new ArrayList<>();
}
else {
this.subtrees = subtrees;
}
}

public boolean is_empty(){
return this.root == null;
}
}