I am having trouble printing out individual Strings from Interable object. I have this given function prefixMatch(String someword) that returns Iterable (that keeps a LinkedList of Strings, I think). I have tried turning it into a list but it wont work. Dose anyone know how to get the Strings out of it one by one?
tst is a Ternary search tree
Iterable<String> words = tst.prefixMatch(word);
If it's Iterable
you can do an extended for on it.
Iterable<String> iterable;
for(String s : iterable){
//Do whatever you want
}
Resources:
Related topics:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With