subject

(a) if the following switch statement were implemented using a jump table, how many elements would the table contain?

would it make sense to use a jump table to implement this switch statement? why or why not? if not then what type of implementation will be more suitable?

why?

switch (i) {

case 40: j = a; break;

case 41: j = b; break;

case 42: j = c; break;

case 43: j = d; break;

case 44: j = e; break;

case 45: j = r; break;

case 46: j = g; break;

}

(b) answer the same questions as in part (a), using the following switch statement instead:

switch (i) {

case 20: j = a; break;

case 67: j = b; break;

case 97: j = c; break;

case 400: j = d; break;

case 310: j = e; break;

case 10: j = f; break;

}

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:20, codie1103
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, addisonrausch
What season was better from fortnite?
Answers: 2
image
Computers and Technology, 23.06.2019 09:30, nsjcbdhcb
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, ayoismeisjjjjuan
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
You know the right answer?
(a) if the following switch statement were implemented using a jump table, how many elements would t...

Questions in other subjects:

Konu
Geography, 06.02.2022 19:40