subject

So i'm using kahn academy but it keeps saying i have bad invocation in {guess = 3((max + min) / 2); } right before the three. i am not sure what i'm doing wrong can someone ? (this is using javascript) ? i will give good points and brainliest. the instructions given were: 1. let min = 0 and max = n-1.2. if max < min, then stop: target is not present in array. return -1.3. compute guess as the average of max and min, rounded down (so that it is an integer).4. if array[guess] equals target, then stop. you found it! return guess.5. if the guess was too low, that is, array[guess] < target, then set min = guess + 1.6. otherwise, the guess was too high. set max = guess - 1.7. go back to step 2./* returns either the index of the location in the array, or -1 if the array did not contain the targetvalue */var min = 0; var max = array. length - 1; var guess; while (min < max) {guess = 3((max + min) / 2); if (array[guess] === targetvalue) {return guess; } else if (array[guess] < targetvalue) {min = guess - 1; } else {max = guess + 1; }}return -1; }; var primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]; var result = dosearch(primes, 73); console. log("found prime at index " + result); //print (primes[]); //program. assertequal(dosearch(primes, 73), 20);

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:40, malibu777
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
image
Computers and Technology, 22.06.2019 22:30, hmontalvo22
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
image
Computers and Technology, 23.06.2019 09:00, Riddledjam44623
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, dimondqueen511
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
You know the right answer?
So i'm using kahn academy but it keeps saying i have bad invocation in {guess = 3((max + min) / 2);...

Questions in other subjects:

Konu
Mathematics, 13.09.2021 08:10
Konu
Biology, 13.09.2021 08:10
Konu
Mathematics, 13.09.2021 08:10