subject

Will give brainliest and good amount of points, no false answers. i am using javascript for school and i still have no idea what i am doing. can someone ? the instructions are, a key step in many sorting algorithms (including selection sort) is swapping the location of two items in an array. here's a swap function that looks like it might work, but doesn't: -the code prints out [9, 9, 4] when it should print out [9, 7, 4]. fix the swap function. hint: work through the code line by line, writing down the values of items in the array after each step. could you use an extra temporary variable to solve the problem that shows up? once implemented, uncomment the program. assertequal() at the bottom to verify that the test assertion passes. the layout for javascript is, var swap = function(array, firstindex, secondindex) { array[firstindex] = array[secondindex]; array[secondindex] = array[firstindex]; }; var testarray = [7, 9, 4]; swap(testarray, 0, 1); println(testarray); //program. assertequal(testarray, [9, 7, 4]);

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:10
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 23.06.2019 21:00
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Does anybody know how to hack into a google account? i had important information on it and it is gone now and i need getting it back.
Answers: 1
You know the right answer?
Will give brainliest and good amount of points, no false answers. i am using javascript for school a...
Questions