Tải bản đầy đủ (.pdf) (7 trang)

a0010 algorithms data structures and problem solving with c morebook vn 2769

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (22.54 KB, 7 trang )

Copyright  1996 by Addison-Wesley Publishing Company

Chapter 1
Pointers, Arrays, and Structures

1


Copyright  1996 by Addison-Wesley Publishing Company

(&X) 1000

X=5

(&Y) 1004

Y=7

2

5
Ptr

(&Ptr) 1200

1000

Pointer illustration

X



Copyright  1996 by Addison-Wesley Publishing Company

(&X) 1000

X = 10

(&Y) 1004

Y=7

3

10
Ptr

(&Ptr) 1200

Ptr = &X = 1000

Result of *Ptr=10

X


Copyright  1996 by Addison-Wesley Publishing Company

(&X) 1000

X=5


(&Y) 1004

Y=7

5
Ptr

(&Ptr) 1200

Ptr = ?

Uninitialized pointer

4

X


Copyright  1996 by Addison-Wesley Publishing Company

5
Ptr1

X

5
Ptr1

X


7
Ptr2

Y
(a)

5

Ptr1

7
Ptr2

Y

Ptr2

(b)

(a) Initial state; (b) Ptr1=Ptr2 starting from initial state;
(c) *Ptr1=*Ptr2 starting from initial state


Copyright  1996 by Addison-Wesley Publishing Company

216

26 41 66 87


8 18

35 38

2 8 18
4 10 20
6 12 22
14 24
16

26 35 38
28 36 39
30 37 40
31
32

48 51 54 57

72 78 83

41 48 51 54 57 66 72 78 83
42 49 52 55 58 68 73 79 84
44 50 53 56 59 69 74 81 85
46
70 76

Insertion of 40 in B-tree in Figure 18.72 causes a split into
two leaves and then a split of the parent node



Copyright  1996 by Addison-Wesley Publishing Company

217

26 41 66 83

8 18

35 38

2 8 18
4 10 20
6 12 22
14 24
16

26 35 38
28 36 39
30 37 40
31
32

48 51 54 57

72 78

41 48 51 54 57 66 72 78
42 49 52 55 58 68 73 79
44 50 53 56 59 69 74 81
46

70 76

B-tree after deletion of 99 from Figure 18.73



×