Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 8 - Data Abstractions - Chapter Review Problems - Page 409: 15

Answer

See the explanation

Work Step by Step

Identify the Letters and Their Addresses Address Letter 60 O 63 C 66 A 69 L 72 R Each letter is followed by two pointer cells: - First pointer: next letter in the name "Carol" - Second pointer: next letter in alphabetical order Build the "Carol" Order Carol is: C → A → R → O → L So the first pointers should be: 63 (C) → 66 (A) 66 (A) → 72 (R) 72 (R) → 60 (O) 60 (O) → 69 (L) 69 (L) → null (end) We'll place these in the first pointer cells: Address Contents First Pointer Second Pointer 63 C 64 → 66 (A) 65 → ? 66 A 67 → 72 (R) 68 → ? 72 R 73 → 60 (O) 74 → ? 60 O 61 → 69 (L) 62 → ? 69 L 70 → 0 71 → ? Step 3: Build Alphabetical Order: A → C → L → O → R So the second pointers should be: 66 (A) → 63 (C) 63 (C) → 69 (L) 69 (L) → 60 (O) 60 (O) → 72 (R) 72 (R) → null Now we fill in the second pointer column: Address Contents First Pointer Second Pointer 66 A 67 → 72 (R) 68 → 63 (C) 63 C 64 → 66 (A) 65 → 69 (L) 69 L 70 → 0 71 → 60 (O) 60 O 61 → 69 (L) 62 → 72 (R) 72 R 73 → 60 (O) 74 → 0 Final Answer Head Pointers: - Carol order head: 63 (C) - Alphabetical order head: 66 (A)
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.