Table of Contents
PPT Slide
List
To implement the List ADT
How to implement a list?
Implementing hierarchy for a list ADT
A Linked List
Singly Linked List
Nodes can be located anywhere in memory
Declarations for a Singly Linked List
Pointer Dereferencing and Member Selection
ptr is a pointer to a node
*ptr is the node pointed to by ptr
ptr->info is a node member
ptr->next is a node member
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Traversing a Singly Linked List
Using operator new
Inserting a node at the front of a list
Inserting a node at the front of a list
Inserting a node at the front of a list
Inserting a node at the front of a list
Inserting a node at the front of a list
Inserting a node at the front of a list
Using operator delete
Deleting the first node from the list
Deleting the first node from the list
Deleting the first node from the list
Deleting the first node from the list
Deleting the first node from the list
What is a List?
ADT Unsorted List Operations
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
Insert into the PersonList
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
Insert algorithm
PPT Slide
InsertItem algorithm for Sorted Linked List
Implementing SortedListmember function InsertItem
PPT Slide
PPT Slide
PPT Slide
PPT Slide
PPT Slide
Recursion with linked lists
General format formany recursive functions
struct NodeType
RevPrint(listData);
Base Case and General Case
Using recursion with a linked list
Use a recursive solution when:
|