Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
¿Cómo determinar si el valor existe en el nodo de destino o en los nodos descendientes a través de un árbol?

Aquí está el código de entrada:

 var newTree = {}; newTree.value = value; newTree.children = [] // fix me Object.assign(newTree, treeMethods) return newTree; }; var treeMethods = {}; treeMethods.addChild = function(value) { const newNode = Tree(value); this.children.push(newNode) }; treeMethods.contains = function(target) { let currentTree = this.children while (currentTree != null) { if (currentTree.indexOf(target) > -1) return true currentTree = this.children[target] } return false };

Estoy tratando de determinar si, dado un valor de destino a través de la función contiene, puedo encontrar el valor de destino llamado a contains() en nodos principales o nodos descendientes.

Por favor, no me des la respuesta completa, pero si pudieras empujarme en la dirección correcta.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!