Check if a Char is in a Node
public static boolean isCharInNode(Character c, Node<Character> N)
{
Node<Character> duplicate = N;
if(duplicate == null)
return false;
while(duplicate.hasNext())
{
if(c == duplicate.getValue())
return true;
else
duplicate = duplicate.getNext();
}
if(c == duplicate.getValue())
return true;
return false;
}
Comments