7. The following memory addresses which represent a linked list of characters in
ID: 3907313 • Letter: 7
Question
7. The following memory addresses which represent a linked list of characters in the word ship, and the value of the corresponding head pointer is 22 hex. Change as few pointer values as possible to form the word shop. If you no longer are using a node you can modify its pointer value.
Original list:
Address (in hex):
20
21
22
23
24
25
26
27
28
29
Contents:
'I'
26
'S'
28
'O'
24
'P'
0
'H'
20
Altered list:
Address (in hex):
20
21
22
23
24
25
26
27
28
29
Contents:
'I'
'S'
'O'
'P'
'H'
Address (in hex):
20
21
22
23
24
25
26
27
28
29
Contents:
'I'
26
'S'
28
'O'
24
'P'
0
'H'
20
Explanation / Answer
Altered list:
head pointer is 22 hex
The sequence of pointers is
22('S')->23->28('H')->29->24('O')->25->26('P')->27->0(end)
Do ask if any doubt. Please upvote.
Address (in hex): 20 21 22 23 24 25 26 27 28 29 Contents: 'I' 20 'S' 28 'O' 26 'P' 0 'H' 24