1_Answers_LL_15

1_Answers_LL_15 - CIS 15BG Answers Chapter 15 LINKED LISTS...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 15BG Answers Chapter 15 LINKED LISTS 1. Imagine we have a linked list as shown below. What would happen if we apply the following statements to the list? Draw "the answer". Note that each statement does not affect the other statements and it is only based upon the original assumptions: Assume : p->data = 10; q->data = 20; r->data = 15; and that p points to the first node in the list, q to the second, r to the third, and t to the last one. (A). p = p->link; (B). q = p; (C). r = p->link; (D). q->data = r->data; (E). p->data = q->link->data; (F). t->link = p; 2. A NODE in a linked list has two fields: part , a structure of type PART, and next , a pointer to the next node. The PART structure has three fields: code , an integer, name , a 1 p q r p q r p q r 10 15 15 p q r p q r p q r t t t t t t 10 20 15 10 20 15 10 20 15 15 20 15 10 20 15
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CIS 15BG Answers Chapter 15 LINKED LISTS dynamically allocated string, and an array of 10 suppliers' codes (also integers) named sAry . (A). Write the definition for the NODE and PART structures.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/02/2011 for the course CIS 15BG taught by Professor Staff during the Winter '10 term at DeAnza College.

Page1 / 3

1_Answers_LL_15 - CIS 15BG Answers Chapter 15 LINKED LISTS...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online