Answer:
The answer is "2".
Explanation:
In the given question some information is missing, that is "The propagation time for satellite to earth" which is "270 milliseconds" so, the description to this question can be defined as follows:
Given values:
Bandwidth = 64 kbps
Data frames = 512 bytes
Propagation Time (tp ) =270 ms
Change Bandwidth kbps to bps:
1 kb= 1024 bytes
calculated bandwidth= 64 kbps = 64×1024 bps = 65536 bps
1 bytes = 8 bits
512 bytes = 512 × 8 = 4096 bits
Frame length = 4096 bits
Formula
Transmission time (Tt) = Frame length /Bandwidth
Window size = 1+2a
where a = Propagation time/Transmission time
Calculate Transmission time:
Transmission time (Tt) = 4096 / 65536
Transmission time (Tt)= 625 m.sec
Calculate Window size:
Window size = 1+2(270/625)
Window size
= 1+2(0.432)
Window size
= 1+0.864
Window size = 1.864
Window size
= 2
I've included my code in the picture below. Best of luck
Um whichever is better for you! ummm whats the point of this question?
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.
D. mouse that is your answer <span />