function result = classify_corners(tree, test)
% classify whether the given example is a corner

if isempty(tree.left) && isempty(tree.mid) && isempty(tree.right)
    result = tree.val;
    return;
end

condition_num = tree.val;

if test(condition_num) == 0
    result = classify_corners(tree.left, test);
elseif test(condition_num) == 1
    result = classify_corners(tree.mid, test);
else
    result = classify_corners(tree.right, test); 
end

end