Analysis of Algorithms : An Active Learning Approach

(Ron) #1
RESULTS OF CHAPTER STUDY SUGGESTIONS 273

Boyer–Moore
The pattern is
abcbccabc
After the first loop the jump array contains


After the second loop the jump array contains


After the second loop the link array contains


After the third loop the jump array contains


After the fourth loop the jump array contains


Chapter 6
Depth-first traversal from node A


A, B, G, C, D, H, L, K, J, F, I, E

Breadth-first traversal from node A


A, B, E, F, G, I, C, L, D, H, K, J

Dijkstra-Prim minimum spanning tree trace


17 16 15 14 13 12 11 10 9

17 16 15 14 13 12 6 4 1

7878899910

14131211109641

14131211109641

I

E

C

C

E

F

I

B

A

3
9

8
8

7

1

2

5
A

B
Free download pdf