System.NullReferenceException: Object reference not set to an instance of an object
public int find(int value) {
Node curr = root;
while (curr != null) {
if (curr.value == value) {
return value;//success
}
if (curr.value < value) {
curr = curr.lChild;
}
if (curr.value > value) {
curr = curr.rChild;
}
if (curr.value == null) {
break;
}
}
return 0;//No Value
}
I cant see whats wrong with the configuration of this binaryTree Search