Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Structures: A Pseudocode Approach with C 1 Chapter 5 Objectives Upon completion you will be able to: Explain the design, use, and operation of a linear.

Similar presentations


Presentation on theme: "Data Structures: A Pseudocode Approach with C 1 Chapter 5 Objectives Upon completion you will be able to: Explain the design, use, and operation of a linear."— Presentation transcript:

1 Data Structures: A Pseudocode Approach with C 1 Chapter 5 Objectives Upon completion you will be able to: Explain the design, use, and operation of a linear list Implement a linear list using a linked list structure Understand the operation of the linear list ADT Write application programs using the linear list ADT Design and implement different link-list structures List General Linear Lists

2 Data Structures: A Pseudocode Approach with C 2 General linear lists A general linear list is a list in which operations can be done anywhere in the list. For simplicity, we refer to general linear lists as lists.

3 Data Structures: A Pseudocode Approach with C 3 5-1 Basic Operations We begin with a discussion of the basic list operations. Each operation is developed using before and after figures to show the changes. Insertion Deletion Retrieval Traversal

4 Data Structures: A Pseudocode Approach with C 4 insertion Insertion is used to add a new element to the list

5 Data Structures: A Pseudocode Approach with C 5 deletion Deletion is used to remove an element from the list.

6 Data Structures: A Pseudocode Approach with C 6 retrieval Retrieval is used to get the information related to an element without changing the structure of the list.

7 Data Structures: A Pseudocode Approach with C 7 traversal List traversal processes each element in a list in sequence.

8 Data Structures: A Pseudocode Approach with C 8 Implementation

9 Data Structures: A Pseudocode Approach with C 9 Data structure

10 Data Structures: A Pseudocode Approach with C 10 Algorithms Create list Insert node Delete node List search Retrieve node Empty list Full list List count Traverse list Destroy list

11 Data Structures: A Pseudocode Approach with C 11 Create list

12 Data Structures: A Pseudocode Approach with C 12 Create list

13 Data Structures: A Pseudocode Approach with C 13 Insert node Only its logical predecessor is needed. There are three steps to the insertion: 1.Allocate memory for the new node and move data to the node. 2.Point the new node to its successor. 3.Point the new node’s predecessor to the new node.

14 Data Structures: A Pseudocode Approach with C 14 Insert node Insert into empty list Insert at beginning Insert in middle Insert at end

15 Data Structures: A Pseudocode Approach with C 15 Insert into empty list

16 Data Structures: A Pseudocode Approach with C 16 Insert at beginning

17 Data Structures: A Pseudocode Approach with C 17 Insert in middle

18 Data Structures: A Pseudocode Approach with C 18 Insert at end

19 Data Structures: A Pseudocode Approach with C 19

20 Data Structures: A Pseudocode Approach with C 20 Delete node Delete first node General delete case

21 Data Structures: A Pseudocode Approach with C 21 Delete first node

22 Data Structures: A Pseudocode Approach with C 22 Delete general case

23 Data Structures: A Pseudocode Approach with C 23

24 Data Structures: A Pseudocode Approach with C 24 List search

25 Data Structures: A Pseudocode Approach with C 25

26 Data Structures: A Pseudocode Approach with C 26

27 Data Structures: A Pseudocode Approach with C 27

28 Data Structures: A Pseudocode Approach with C 28 Retrieve node

29 Data Structures: A Pseudocode Approach with C 29 Empty list

30 Data Structures: A Pseudocode Approach with C 30 Full list

31 Data Structures: A Pseudocode Approach with C 31 List count

32 Data Structures: A Pseudocode Approach with C 32 Traversal list

33 Data Structures: A Pseudocode Approach with C 33

34 Data Structures: A Pseudocode Approach with C 34

35 Data Structures: A Pseudocode Approach with C 35 Destroy list


Download ppt "Data Structures: A Pseudocode Approach with C 1 Chapter 5 Objectives Upon completion you will be able to: Explain the design, use, and operation of a linear."

Similar presentations


Ads by Google