TernarySearchTree2public class TernarySearchTree2 extends Object
Fields Summary |
---|
TernarySearchTreeNode2 | root | char[] | buff |
Constructors Summary |
---|
public TernarySearchTree2()
buff = new char[5000];
|
Methods Summary |
---|
public java.lang.Object | get(java.lang.String s)
if(root == null)
{
return null;
}
else
{
s.getChars(0, s.length(), buff, 0);
return root.search(buff, 0, s.length() - 1);
}
| public java.lang.Object | put(java.lang.String s, java.lang.Object obj)
s.getChars(0, s.length(), buff, 0);
if(root == null)
root = TernarySearchTreeNode2.newNode(buff[0]);
return root.insert(buff, 0, s.length() - 1, obj);
| public void | release()
if(root != null)
{
root.clean();
root = null;
}
|
|