Created
December 6, 2022 21:16
-
-
Save lubaochuan/bfdf2716c6a945618117665942f231f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedList; | |
import java.util.Iterator; | |
public class MyTreeSet{ | |
MyTreeMap map = new MyTreeMap(); | |
public void add(String key){ | |
// TO BE IMPLEMENTED | |
// return false; | |
// add key to set | |
// return true if key is new, false otherwise | |
map.put(key, null); | |
} | |
public Iterator<String> keys(){ | |
// TO BE IMPLEMENTED | |
// return an iterator of keys | |
// return null; | |
return map.keys(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment