Review - PowerPoint PPT Presentation

1 / 53
About This Presentation
Title:

Review

Description:

Review Polish Notation Prefix Infix Postfix Precedence of Operators Converting Infix to Postfix Evaluating Postfix * Insertion Description Insertion at the top of the ... – PowerPoint PPT presentation

Number of Views:86
Avg rating:3.0/5.0
Slides: 54
Provided by: Shah171
Category:

less

Transcript and Presenter's Notes

Title: Review


1
Review
  • Polish Notation
  • Prefix
  • Infix
  • Postfix
  • Precedence of Operators
  • Converting Infix to Postfix
  • Evaluating Postfix

2
Polish Notation
  • Converting Infix to Postfix
  • Converting Postfix to Infix
  • Converting Infix to Prefix
  • Examples

3
Examples
  • Converting Infix to Postfix

4
Examples
  • Converting Infix to Postfix

5
Examples
  • Converting Infix to Postfix

6
Examples
  • Converting Postfix to Infix

7
Examples
  • Converting Postfix to Infix

8
Examples
  • Converting Infix to Prefix

9
Examples
  • Converting Infix to Prefix

10
Summary
  • Converting Infix to Postfix
  • Converting Postfix to Infix
  • Converting Infix to Prefix
  • Examples

11
Review
  • Polish Notation
  • Prefix
  • Infix
  • Postfix
  • Precedence of Operators
  • Converting Infix to Postfix
  • Evaluating Postfix

12
Polish Notation
  • Converting Infix to Postfix
  • Converting Postfix to Infix
  • Converting Infix to Prefix
  • Examples

13
Linked Lists
  • Introduction
  • Insertion Description
  • Deletion Description
  • Basic Node Implementation
  • Conclusion

14
Outline
  • Introduction
  • Insertion Description
  • Deletion Description
  • Basic Node Implementation
  • Conclusion

15
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

16
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

17
Lists and arrays
  • Lists

18
Lists and arrays
  • Arrays
  • Size of the following array is 4

Index 0 1 2 3
Value 44 5 96 3
19
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

20
Nodes and pointers
21
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

22
Single linked lists
23
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

24
Double Linked Lists
25
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

26
Circular Lists
27
Introduction
  • Definitions
  • Lists and arrays
  • Nodes and pointers
  • Single Linked Lists
  • Double Linked Lists
  • Circular Lists
  • Advantages

28
Advantages
  • The Linked List advantages are collected because
    of the array disadvantages, array disadvantages
    are
  • Array Size
  • Memory allocation
  • Insertion and Deletion

29
Outline
  • Introduction
  • Insertion Description
  • Deletion Description
  • Basic Node Implementation
  • Conclusion

30
Insertion Description
  • Insertion at the top of the list
  • Insertion at the end of the list
  • Insertion in the middle of the list

31
Insertion Description
  • Insertion at the top of the list
  • Insertion at the end of the list
  • Insertion in the middle of the list

32
Insertion at the top
  • Steps
  • Create a Node
  • Set the node data Values
  • Connect the pointers

33
Insertion Description
  • Follow the previous steps and we get

Step 1
Step 2
Step 3
34
Insertion Description
  • Insertion at the top of the list
  • Insertion at the end of the list
  • Insertion in the middle of the list

35
Insertion at the end
  • Steps
  • Create a Node
  • Set the node data Values
  • Connect the pointers

36
Insertion Description
  • Follow the previous steps and we get

Step 1
Step 2
Step 3
37
Insertion Description
  • Insertion at the top of the list
  • Insertion at the end of the list
  • Insertion in the middle of the list

38
Insertion in the middle
  • Steps
  • Create a Node
  • Set the node data Values
  • Break pointer connection
  • Re-connect the pointers

39
Insertion Description
Step 1
Step 2
Step 3
Step 4
40
Outline
  • Introduction
  • Insertion Description
  • Deletion Description
  • Basic Node Implementation
  • Conclusion

41
Deletion Description
  • Deleting from the top of the list
  • Deleting from the end of the list
  • Deleting from the middle of the list

42
Deletion Description
  • Deleting from the top of the list
  • Deleting from the end of the list
  • Deleting from the middle of the list

43
Deleting from the top
  • Steps
  • Break the pointer connection
  • Re-connect the nodes
  • Delete the node

44
Deletion Description
head
4
17
head
4
17
head
4
17
45
Deletion Description
  • Deleting from the top of the list
  • Deleting from the end of the list
  • Deleting from the middle of the list

46
Deleting from the end
  • Steps
  • Break the pointer connection
  • Set previous node pointer to NULL
  • Delete the node

47
Deletion Description
head
4
17
head
4
17
head
4
17
48
Deletion Description
  • Deleting from the top of the list
  • Deleting from the end of the list
  • Deleting from the middle of the list

49
Deleting from the Middle
  • Steps
  • Set previous Node pointer to next node
  • Break Node pointer connection
  • Delete the node

50
Deletion Description
head
4
17
head
4
17
head
4
51
Outline
  • Introduction
  • Insertion Description
  • Deletion Description
  • Basic Node Implementation
  • Conclusion

52
Basic Node Implementation
  • The following code is written in C
  • Struct Node
  • int data //any type of data could be another
    struct
  • Node next //this is an important piece of
    code pointer

53
Summary
  • Introduction
  • Insertion Description
  • Deletion Description
  • Basic Node Implementation
  • Conclusion
Write a Comment
User Comments (0)
About PowerShow.com