O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Binary Search Trees 3

Eithne O'Sullivan Inglês

Conteúdo do mapa

Binary Search Trees 3

  1. implementation contd.

    • boolean contains(T element), boolean contains(T element, BTNode<T> current)
      • recursion used : return contains(element, root);
        • code in note->
          • &nbsp;&nbsp; if (current ==null){return false;} // 3 conditions : if (element.compareTo(current.element) == 0){ &nbsp; &nbsp;// we can confirm that the element is in the tree so&nbsp; &nbsp; &nbsp;return true; } else if (element.compareTo(current.element) == -1){ // this means the element has lesser value than the is found at the current node // as such we would traverse the left subtree to look for the element &nbsp; &nbsp; &nbsp;return contains(element, current.left); } else { &nbsp;&nbsp;&nbsp; // this covers the final condition where element is of greater value than is in the current node &nbsp; &nbsp;&nbsp;return contains(element, current.right); } &nbsp;&nbsp;

Informações

Descrição
Mapa Mental sobre Binary Search Trees 3, criado por Eithne O'Sullivan em 04-03-2018.
Visualizações
1
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?