Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiset class conversion #66

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/LinkedListMultiSet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public class LinkedListMultiSet {
// the main body for the LinkedListMultiSet class still needs to be implemented

// the Node class is meant to only be used by the LinkedListMultiSet class so I made it private and nested
// if anyone knows another way to do this can you show me/
private class Node {
private Object item;
private Node next;
public Node(Object item) {
this.item = item;
this.next = null;

}
}
}
32 changes: 32 additions & 0 deletions src/Multiset.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
public class Multiset {
public boolean add(Object item) {
throw new UnsupportedOperationException();

}

public void remove(Object item) {
throw new UnsupportedOperationException();

}

public boolean contains(Object item) {
throw new UnsupportedOperationException();

}

public boolean is_empty() {
throw new UnsupportedOperationException();

}

public int count(Object item) {
throw new UnsupportedOperationException();

}

public int size() {

throw new UnsupportedOperationException();
}

}
16 changes: 15 additions & 1 deletion src/Tree.java
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
import java.util.Collections;
import java.util.List;

public class Tree {
}
private Object _root;
private List<Tree> _subtrees;

public Tree(Object root, Object subtrees) {
this._root = root;
if (subtrees == null) {
this._subtrees = Collections.emptyList();

}
}
}

4 changes: 4 additions & 0 deletions src/TreeMultiSet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public class TreeMultiSet {
private Tree tree;
// Tree class needs to be implemented before this
}