Data Str & Algorithm HW Solutions 70

Data Str & Algorithm HW Solutions 70 - 70 Chap. 11...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
70 Chap. 11 Graphs 11.3 (a) 123456 -------------------------- 1 | 10 20 2 | 2|10 3 5 | 3| 3 1 5 | 4 | 20 5 11 10 | 5 | 15 11 3 | 6|2 1 0 3 | -------------------------- (b) 1 -> 2(10) -> 4(20) -> 6(2) -> \ 2 -> 1(10) -> 3(3) -> 4(5) -> \ 3 -> 2(3) -> 5(15) -> \ 4 -> 1(20) -> 2(5) -> 5(11) -> 6(10) -> \ 5 -> 3(15) -> 4(11) -> 6(3) -> \ 6 -> 1(2) -> 4(10) -> 5(3) -> \ (c) The adjacency matrix requires 36 × 2=72 bytes. The adjacency list requires 24 × 4+18 × (2 + 2) = 168 bytes. Thus, the matrix is considerably more ef f cient in this case. 11.4 1->2 6<--4 V| 3 -----> 5 11.5 1->2->3 |\ V\ 6V 4->5 11.6 Add the following at the end of algorithm on Page 206:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/27/2011 for the course MAP 2302 taught by Professor Bell,d during the Fall '08 term at UNF.

Ask a homework question - tutors are online