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

236
Views
Cómo usar el empalme y la búsqueda binaria en los datos para eliminar y buscar

Estoy intentando el método de empalme, pero no funciona correctamente. Quiero eliminar un usuario, pero está eliminando 2.

También quiero agregar el botón de búsqueda binaria

este es el requisito para la búsqueda binaria

Reemplace el algoritmo de acceso secuencial para operar en las matrices con un algoritmo de búsqueda binaria. Para implementar esto, los datos de la matriz deben ordenarse. Puede consultar un ejemplo en línea disponible en Array.prototype.sort() para obtener información sobre la clasificación de datos en matrices.

 function Display_Athlete() { var text = "<hr/>"; for (let i = 0; i < athlete_name.length; i++) { text += "Athlete No - " + (i + 1) + ", Athlete Name is " + athlete_name[i] + " and height is " + athlete_height[i] + "<br>"; } document.getElementById("message").innerHTML = text; } //Created function to remove the user function Remove_Athlete() { var person = prompt("Enter the name to remove the Athlete"); for (let i = 0; i < athlete_name.length; i++) { athlete_name.splice(person - 1, 1); athlete_height.splice(person - 1, 1); alert(" Athlete_name " + athlete_name + " Athlete_height " + athlete_height + " is removed "); } } //Create the function to find the user function Find_Athlete() { var person = prompt("Enter the name to Find the Athlete"); var text = ""; for (let i = 0; i < athlete_name.length; i++) { if (athlete_name[i] == person) { text += "Athlete No - " + (i + 1) + ", Athlete Name is " + athlete_name[i] + " and height is " + athlete_height[i] + "<br>"; } } document.getElementById("message").innerHTML = text; if (text == "") alert(`${person} Invalid Athlete name`); return ""; } function Binary_Search(){ }
about 4 years ago · Santiago Gelvez
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!