Computer Science Help
Can someone explain to me how elements are added in a treeset?
December 5, 2013
Computer Science Help
Can someone explain to me how elements are added in a treeset?
3 Comments • Newest first
i got it, thanks for your help guys
It's just a series of nodes that branch out. What the first poster did was correct.
It'll be harder if you wanted a sort binary tree though, those can be difficult to code, but have O(n) time
[quote=Harlequinist]public static void main(String args[]) {
TreeSet blah = new TreeSet();
blah.add("I'm" );
blah.add("so" );
blah.add("awesome" );
System.out.println(blah);
}[/quote]
what would the data structure look like if i were to draw a diagram?