Set-associative mapping allows that each word that is present in the cache can have two or more words in the main memory for the same index address. Set associative cache mapping combines the best of direct and associative cache mapping techniques.
Answer:
The answer is (C)
Let’s run the algorithm on a small input to see the working process.
Let say we have an array {3, 4, 1, 5, 2, 7, 6}. MAX = 7
- Now for i=0, i < 7/2, here we exchange the value at ith index with value at (MAX-i-1)th index.
- So the array becomes {6, 4, 1, 5, 2, 7, 3}. //value at 0th index =3 and value at (7-0-1)th index is 6.
- Then for i=1, i < 7/2, the value at index 1 and (7-1-1)=5 are swapped.
- So the array becomes {6, 7, 1, 5, 2, 4, 3}.
- Then for i=2, i < 7/2, the value at index 2 and (7-2-1)=4 are swapped.
- So the array becomes {6, 7, 2, 5, 1, 4, 3}.
- Then for i=3, i not < 7/2, so stop here.
- Now the current array is {6, 7, 2, 5, 1, 4, 3} and the previous array was{3, 4, 1, 5, 2, 7, 6}.
Explanation:
So from the above execution, we got that the program reverses the numbers stored in the array.
Answer: No Answer
Explanation: No Explanation
Answer:
The output is 35
Explanation:
Required
Determine the output on line 5
We start by analysing the program line by line.
On line 1: kit = 20
On line 2: roo = 10
On line 3: kit = kit + 5
Substitute 20 for kit.
So, we have
kit = 20 + 5
kit = 25
On line 4:
roo = kit + roo
Substitute values for kit and too
roo = 25 + 10
roo = 35
On line 5: Output roo
So, 35 is displayed as an output