The list below represents the contents of a computer's main memory. I've left every other byte blank. Assume that the letters at the even addresses are items in linked list, and that the odd addresses will be used as links. Each link is a memory address. In your answer to this question, fill in the addresses so that the linked list is in alphabetical order. Note that the head pointer of this list should have the address 16. Use the address 00 to denote the nil pointer. NOTE: don't move the contents of the even addressed bytes; just change the links by changing the addresses stored at the odd addressed bytes.

Head: 16

Address Contents

12 t

13 00

14 m

15 18

16 a

17 14

18 r

19 20

20 s

21 13

Use the same array as shown in Questions 3, change the links to spell the work 'smart'. First of all, what address should the head pointer have now? Next, write out the list with the links filled in appropriately to make the list spell 'smart'. Use the address 00 to denote the nil pointer. NOTE: don't move the contents of the even addressed bytes; just change the links.

The head pointer is: ________________

Address Contents

12 t

13 _____________

14 m

15 _____________

16 a

17 _____________

18 r

19 _____________

20 s

21 _____________

Respuesta :

Answer:

3) A Single linked list is a sequence of elements in which every element has link to its next element in the sequence.

DATA LINK

DATA stores actual value , LINK stores address of next node

As per information given in question, letters at the even addresses are items in linked list and the odd addresses will be used as links.

Even Address Odd Address

12 (Stores 't') 13 (Used as link)

14 (Stores 'm') 15 (Used as link)

16 (Stores 'a') 17 (Used as link)

18 (Stores 'r') 19 (Used as link)

20 (Stores 's') 21 (Used as link)

Numbers represented by circle are addresses of respective nodes. Here Front or Head has address 16. Which represents the Head Node.

Following image represents the word "smart" with respective nodes and their addressing.

Numbers represented by circle are addresses of respective nodes.

The head pointer is: 20

ACCESS MORE
EDU ACCESS
Universidad de Mexico