1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ivann1987 [24]
3 years ago
5

Will give brainliest and good amount of points, no false answers.

Computers and Technology
1 answer:
nlexa [21]3 years ago
7 0

The problem with the swap function is that it loses the value at the first index, as soon as it gets overwritten by the value at the second index. This happens in the first statement. To fix it, you need a helper variable.

First you're going to "park" the index at the first index in that helper variable, then you can safely overwrite it with the value at the second index. Then finally you can write the parked value to the second index:

var swap = function(array, firstIndex, secondIndex) {

let helper = array[firstIndex];

array[firstIndex]  = array[secondIndex];

array[secondIndex] = helper;

};

I hope this makes sense to you.

You might be interested in
write a program to update the rate by increasing 20% from sequential data file "items.dat" that store item name.rate and quantit
sveticcg [70]

Answer:

your answer is in the pic

(◔‿◔)

。◕‿◕。

6 0
2 years ago
How does technology improve productivity at home? (Select all that apply.)
Aliun [14]

Answer:

B, C

Explanation:

?

5 0
3 years ago
Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
Kipish [7]

Answer:

code = 010100000001101000101

Explanation:

Steps:

The inequality yields 2^{k} - 1 > = M+K, where M = 16. Therefore,

The second step will be to arrange the data bits and check the bits. This will be as follows:

Bit position              number              Check bits            Data Bits

21                                   10101

20                                  10100

The bits are checked up to bit position 1

Thus, the code is 010100000001101000101

3 0
3 years ago
Read 2 more answers
You can use the Trim Video feature to specify a video file’s Start and End time in order to control which portion of the video f
mario62 [17]

Answer:

True

Explanation:

You can trim a video and actually set the start time and end time of a video on Powerpoint (a presentation software by microsoft) by following some simple steps.

select the video and click the playback tab, click the Trim video and a box will pop up, you can play the video and see how it is trimmed, and finally click OK.

5 0
3 years ago
Consider the following algorithms. Each algorithm operates on a list containing n elements, where n is a very large integer.
DochEvi [55]

We have that the appropriate statement will be

  • An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the algorithms run in reasonable time

III only.

Option B

From the question we are told

Consider the following <u>algorithms</u>. Each <u>algorithm</u> operates on a list containing n <em>elements</em>, where n is a very large <u>integer</u>.

I. An algorithm that accesses each <u>element</u> in the list twice.

II. An <em>algorithm </em>that accesses each <u>element </u>in the list n times.

III. An <u>algorithm</u> that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the <em>algorithms </em>run in <em>reasonable </em>time?

<h3>Algorithm  </h3>

Generally In order to get <em>admission </em>to every thing in the list twice, the algorithm has to traverse the listing twice,

which leads to 2*n entry to operations.

And if the every factor is accessed n times, the listing will be traversed n time, which leads to n^2 get right of entry to operations.

If n is a very giant <em>integer</em>, each 2*n and n^2 are plenty larger.

So, there will be <em>solely </em>ten entry to operations and this algorithm will have a sensible jogging time.

Therefore

An algorithm that accesses only the first 10 elements in the list, regardless of the size of the list. Which of the algorithms run in reasonable time

III only.

Option B

For more information on  algorithm  visit

brainly.com/question/950632

4 0
2 years ago
Other questions:
  • What must be done if the intended destination hardware is not supported by the chosen OS?
    6·1 answer
  • Illustrate the process of using an operating system to manipulate a computer’s desktop, files and disks.
    12·1 answer
  • Each computer or device on a network is called a(n) ______.
    7·1 answer
  • Sanjay is giving a slideshow presentation on his entire college class and he is feeling quite nervous in order to share his pres
    9·1 answer
  • ICT excel data homework
    10·1 answer
  • Write a program to calculate the great circle distance between two points on the surface of a sphere. If p1(x1, y1) and p2(x2,y2
    5·1 answer
  • The computer addicts are conscious about their addiction. True or false
    9·1 answer
  • 11) A single inheritance model means: * A) A class can only have one parent class (superclass) B) A class can only have one chil
    7·1 answer
  • Help plz
    10·1 answer
  • The output of a computer can be seen on ( monitor, keyboard or mouse )​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!