Empleador activo
Write a function that returns the depth of a tree.
Anónimo
int finddepth(node_t* node) { if(node == NULL) return -1; else return 1 + MAX(finddepth(node->lchild), finddepth(node->rchild)); }
Slightly simplified :] (I think this works; not doubling up on the recursive calls either) public static int depth(Node root, int level) { if (root == null) return level-1; return Math.max(depth(root.right, level+1), depth(root.left, level+1)); }
public static int depth(Node root, int level) { if(root != null) { if(depth(root.right, level + 1) > depth(root.left, level + 1)) return depth(root.right, level + 1); else return depth(root.left, level + 1); } return level; }
Sigue a tus empresas favoritas para estar al tanto de las últimas oportunidades y disponer de información desde adentro.
Recibe recomendaciones y actualizaciones personalizadas al iniciar tu búsqueda.