© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Problem Solving & Program Design in C Seventh Edition By Jeri R. Hanly & Elliot B. Koffman Chapter 13: Dynamic Data Structures
1-2 © 2012 Pearson Addison-Wesley. All rights reserved. 1-2 Figure 13.1 Comparison of Pointer and Nonpointer Variables
1-3 © 2012 Pearson Addison-Wesley. All rights reserved. 1-3 Figure 13.2 Function with Pointers as Output Parameters
1-4 © 2012 Pearson Addison-Wesley. All rights reserved. 1-4 Figure 13.3 Data Area of a Function with Three Pointer-Type Local Variables
1-5 © 2012 Pearson Addison-Wesley. All rights reserved. 1-5 Figure 13.4 Dynamic Allocation of Variables for an int, a char, and a Five-Component planet_t Structure
1-6 © 2012 Pearson Addison-Wesley. All rights reserved. 1-6 Figure 13.5 Assignment of Values to Dynamically Allocated Variables
1-7 © 2012 Pearson Addison-Wesley. All rights reserved. 1-7 Figure 13.6 Referencing Components of a Dynamically Allocated Structure
1-8 © 2012 Pearson Addison-Wesley. All rights reserved. 1-8 Figure 13.7 Allocation of Arrays with calloc
1-9 © 2012 Pearson Addison-Wesley. All rights reserved. 1-9 Figure 13.7 Allocation of Arrays with calloc (cont’d)
1-10 © 2012 Pearson Addison-Wesley. All rights reserved Figure 13.8 Stack and Heap After Program Fragment in Fig. 13.7
1-11 © 2012 Pearson Addison-Wesley. All rights reserved Figure 13.9 Multiple Pointers to a Cell in the Heap
1-12 © 2012 Pearson Addison-Wesley. All rights reserved Figure Children’s Pop Beads in a Chain
1-13 © 2012 Pearson Addison-Wesley. All rights reserved Figure Multiple Pointers to the Same Structure
1-14 © 2012 Pearson Addison-Wesley. All rights reserved Figure Linking Two Nodes
1-15 © 2012 Pearson Addison-Wesley. All rights reserved Figure Three-Node Linked List with Undefined Final Pointer
1-16 © 2012 Pearson Addison-Wesley. All rights reserved Figure Three-Element Linked List Accessed Through n1_p
1-17 © 2012 Pearson Addison-Wesley. All rights reserved Figure Linked List After an Insertion
1-18 © 2012 Pearson Addison-Wesley. All rights reserved Figure Linked List After a Deletion
1-19 © 2012 Pearson Addison-Wesley. All rights reserved Figure Function print_list
1-20 © 2012 Pearson Addison-Wesley. All rights reserved Figure Comparison of Recursive and Iterative List Printing
1-21 © 2012 Pearson Addison-Wesley. All rights reserved Figure Update of List-Traversing Loop Control Variable
1-22 © 2012 Pearson Addison-Wesley. All rights reserved Figure Function print_list
1-23 © 2012 Pearson Addison-Wesley. All rights reserved Figure Iterative Function get_list
1-24 © 2012 Pearson Addison-Wesley. All rights reserved Figure Function search
1-25 © 2012 Pearson Addison-Wesley. All rights reserved Figure Linked List Representation of Stacks
1-26 © 2012 Pearson Addison-Wesley. All rights reserved Figure Structure Types for a Linked List Implementation of a Stack
1-27 © 2012 Pearson Addison-Wesley. All rights reserved Figure Stack Manipulation with Function push and pop
1-28 © 2012 Pearson Addison-Wesley. All rights reserved Figure Stack Manipulation with Function push and pop (cont’d)
1-29 © 2012 Pearson Addison-Wesley. All rights reserved Figure Structure Types for a Linked List Implementation of a Queue
1-30 © 2012 Pearson Addison-Wesley. All rights reserved Figure A Queue of Passengers in a Ticket Line
1-31 © 2012 Pearson Addison-Wesley. All rights reserved Figure Creating and maintaining a Queue
1-32 © 2012 Pearson Addison-Wesley. All rights reserved Figure Creating and maintaining a Queue (cont’d)
1-33 © 2012 Pearson Addison-Wesley. All rights reserved Figure Functions add_to_q and remove_from-q
1-34 © 2012 Pearson Addison-Wesley. All rights reserved Figure Functions add_to_q and remove_from-q (cont’d)
1-35 © 2012 Pearson Addison-Wesley. All rights reserved Figure Addition of One Passenger to a Queue
1-36 © 2012 Pearson Addison-Wesley. All rights reserved Figure Removal of One Passenger to a Queue
1-37 © 2012 Pearson Addison-Wesley. All rights reserved Figure Building an Ordered List through Insertions and Deletions
1-38 © 2012 Pearson Addison-Wesley. All rights reserved Figure Building an Ordered List through Insertions and Deletions (cont’d)
1-39 © 2012 Pearson Addison-Wesley. All rights reserved Figure Cases for Recursive Function insert_in_order
1-40 © 2012 Pearson Addison-Wesley. All rights reserved Figure Function Insert and Recursive Function insert_in_order
1-41 © 2012 Pearson Addison-Wesley. All rights reserved Figure Iterative Function delete
1-42 © 2012 Pearson Addison-Wesley. All rights reserved Figure Iterative Function delete (cont’d)
1-43 © 2012 Pearson Addison-Wesley. All rights reserved Figure Function delete Using Recursive Helper Function
1-44 © 2012 Pearson Addison-Wesley. All rights reserved Figure Recursive Helper Function delete_ ordered_node
1-45 © 2012 Pearson Addison-Wesley. All rights reserved Figure Binary Tree
1-46 © 2012 Pearson Addison-Wesley. All rights reserved Figure Binary Tree Search for 42
1-47 © 2012 Pearson Addison-Wesley. All rights reserved Figure Building a Binary Search Tree
1-48 © 2012 Pearson Addison-Wesley. All rights reserved Figure Building a Binary Search Tree
1-49 © 2012 Pearson Addison-Wesley. All rights reserved Figure Building a Binary Search Tree (cont’d)
1-50 © 2012 Pearson Addison-Wesley. All rights reserved Figure Building a Binary Search Tree (cont’d)