Chapter 4 Linked Stacks and Queues I1 Pointers and Linked Structures I 2. Linked Stacks 3. Linked Stacks with Safeguards 4. Linked Queues 5. Application: Polynomial Arithmetic 6. Abstract Data Types and Implementations 7. Pointers and Pitfalls
Chapter 4 Linked Stacks and Queues 1. Pointers and Linked Structures 2. Linked Stacks 3. Linked Stacks with Safeguards 4. Linked Queues 5. Application: Polynomial Arithmetic 6. Abstract Data Types and Implementations 7. Pointers and Pitfalls
4.1 Pointers and a Linked List A Linked list is a Lynn sequence of zero o Jack more elements called nodes each containing Q Dave two kinds of Marsha information: some data and one or more FRed Jackie links called pointers to 367-2205 2950603 Jan 28 Feb 18 other nodes of the Carol Rene linked list 628-5100 3425153 Feb23 Mar. 15
A Linked List is a sequence of zero or more elements called nodes each containing two kinds of information: some data and one or more links called pointers to other nodes of the linked list. 4.1 Pointers and a Linked List
Head 日-[a[a→…→a囚 Head Head an Head
Key Terms ◆ Overflow Running out of space ◆ Pointer: An object, often a variable, that stores the location(that is the machine address) of some other object, typically of a structure containing data that we wish to manipulate. Also sometimes called a link or a reference) ◆ Linked list: A list in which each entry contains a pointer giving the location of the next entry
Key Terms Overflow: Running out of space. Pointer: An object, often a variable, that stores the location (that is the machine address) of some other object, typically of a structure containing data that we wish to manipulate. (Also sometimes called a link or a reference) Linked list: A list in which each entry contains a pointer giving the location of the next entry
◆ Contiguous Next to each other, touching, adjoining; used in contrast to linked ◆ Automatic object: An object that exists as long as the block of program declaring it is active; referenced by giving it a name when writing the program ◆ Dynamic object An object that is created (and perhaps destroyed) while the program is running accessed indirectly via pointers
Contiguous: Next to each other, touching, adjoining; used in contrast to linked. Automatic object: An object that exists as long as the block of program declaring it is active; referenced by giving it a name when writing the program. Dynamic object: An object that is created (and perhaps destroyed) while the program is running; accessed indirectly via pointers