SlideShare a Scribd company logo
1 of 58
Download to read offline
Objectives ,[object Object],[object Object],[object Object],[object Object]
[object Object],Stacks 7 7 7 7 7 7 7 7 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
[object Object],[object Object],[object Object],[object Object],[object Object],Defining a Stack
[object Object],[object Object],[object Object],Identifying the Operations on Stacks ,[object Object],Empty Stack 1 Push an  Element 1
[object Object],Identifying the Operations on Stacks (Contd.) 1 Push an  Element 2 2 Push an  Element 3 3
[object Object],Identifying the Operations on Stacks (Contd.) 1 POP an  Element  3 2 3 POP an  Element  2
[object Object],Just a minute ,[object Object],[object Object]
[object Object],Just a minute ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Implementing a Stack Using an Array
[object Object],Implementing a Stack Using an Array (Contd.) top =  –   1  PUSH an element 3 Stack 2 1 0 4 3 Initially:
Implementing a Stack Using an Array (Contd.) 10 top =  –   1  Stack 2 1 0 4 3 PUSH an element 3
Implementing a Stack Using an Array (Contd.) 10 top = 0  Stack 2 1 0 4 3 top = 0  PUSH an element 3
Implementing a Stack Using an Array (Contd.) 10 top = 0  10 Stack 2 1 0 4 3 3 Item pushed PUSH an element 3
Implementing a Stack Using an Array (Contd.) 10 top = 0  10 Stack 2 1 0 4 3 3 PUSH an element 8
Implementing a Stack Using an Array (Contd.) 10 top = 0  10 Stack 2 1 0 4 3 3 top = 1  PUSH an element 8
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 top = 1  8 Item pushed PUSH an element 8
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 top = 1  8 PUSH an element 5
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 top = 1  8 top = 2 PUSH an element 5
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 top = 2 5 Item pushed PUSH an element 5
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 top = 2  5 PUSH an element 1
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 top = 2  5 top = 3 PUSH an element 1
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 top = 3 1 Item pushed PUSH an element 1
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 top = 3 1 PUSH an element  9
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 top = 3 1 top = 4 PUSH an element  9
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 top = 4 9 Item pushed PUSH an element  9
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 top = 4 9 PUSH an element  2
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 top = 4 9 top = 5 PUSH an element  2
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 9 top = 5 Stack overflow PUSH an element  2
Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 9 ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Implementing a Stack Using an Array (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Just a minute ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],Applications of Stacks
[object Object],[object Object],Implementing Function Calls
Implementing Function Calls (Contd.) Assuming these instructions at the given locations in the memory.  1100 1101 1103 1120 1121 1122 1140 1141 1102 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The execution starts from function F1 1100 1101 1103 1120 1121 1122 1140 1141 1102 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1100 1101 1103 1120 1121 1122 1140 1141 1102 Implementing Function Calls (Contd.)
x = 5 1100 1101 1103 1120 1121 1122 1140 1141 1102 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
x = 5 Address and the local variable of F1   1100 1101 1103 1120 1121 1122 1140 1141 1102 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1103, x = 5
x = 10 1100 1101 1103 1120 1121 1122 1140 1141 1102 x = 5 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1103, x = 5
1122, x = 10 Address and the local variable of F2  1100 1101 1103 1120 1121 1122 1140 1141 1102 x = 10 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1103, x = 5
x = 20 Address and the local variable of F2  1100 1101 1103 1120 1121 1122 1140 1141 1102 x = 10 1122, x = 10 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1103, x = 5
1100 1101 1103 1120 1121 1122 1140 1141 1102 20 x = 20 x = 10 1122, x = 10 1122, x = 10 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1103, x = 5
1100 1101 1103 1120 1121 1122 1140 1141 1102 20 10 x = 5 1103, x = 5 x = 10 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1103, x = 5
1100 1101 1103 1120 1121 1122 1140 1141 1102 20 10 5 x = 5 Implementing Function Calls (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],Maintaining the UNDO list for an Application
[object Object],[object Object],[object Object],[object Object],Checking the Nesting of Parentheses in an Expression
[object Object],[object Object],[object Object],Implementing Stacks
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],{ {(a + b)  ×  (c + d) ]} Implementing Stacks (Contd.)
[object Object],[object Object],[object Object],[object Object],[object Object],{ ( {(a + b)  ×  (c + d) ]} Implementing Stacks (Contd.)
[object Object],[object Object],[object Object],{ ( ) ( Brackets Matched {(a + b)  ×  (c + d) ]} Implementing Stacks (Contd.)
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],{ ( {(a + b)  ×  (c + d) ]} Implementing Stacks (Contd.)
[object Object],[object Object],[object Object],{ ( ) ( Brackets Matched {(a + b)  ×  (c + d) ]} Implementing Stacks (Contd.)
[object Object],[object Object],[object Object],{ ] { Brackets Do Not Match The Expression is INVALID {(a + b)  ×  (c + d) ]} Implementing Stacks (Contd.)
Algorithm for Balanced Symbol Checking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Evaluating Expressions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary (Contd.) ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Clips basics how to make expert system in clips | facts adding | rules makin...
Clips basics  how to make expert system in clips | facts adding | rules makin...Clips basics  how to make expert system in clips | facts adding | rules makin...
Clips basics how to make expert system in clips | facts adding | rules makin...NaumanMalik30
 
Understanding Lemon Generated Parser Final
Understanding Lemon Generated Parser FinalUnderstanding Lemon Generated Parser Final
Understanding Lemon Generated Parser Finalvivekanandan r
 
Event Stream Processing with Multiple Threads
Event Stream Processing with Multiple ThreadsEvent Stream Processing with Multiple Threads
Event Stream Processing with Multiple ThreadsSylvain Hallé
 
The Ring programming language version 1.3 book - Part 18 of 88
The Ring programming language version 1.3 book - Part 18 of 88The Ring programming language version 1.3 book - Part 18 of 88
The Ring programming language version 1.3 book - Part 18 of 88Mahmoud Samir Fayed
 
Understanding Lemon Generated Parser
Understanding Lemon Generated ParserUnderstanding Lemon Generated Parser
Understanding Lemon Generated Parservivekanandan r
 
Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11Stefano Leli
 
The Ring programming language version 1.6 book - Part 34 of 189
The Ring programming language version 1.6 book - Part 34 of 189The Ring programming language version 1.6 book - Part 34 of 189
The Ring programming language version 1.6 book - Part 34 of 189Mahmoud Samir Fayed
 
Introduction to Python and TensorFlow
Introduction to Python and TensorFlowIntroduction to Python and TensorFlow
Introduction to Python and TensorFlowBayu Aldi Yansyah
 
Python Programming: Data Structure
Python Programming: Data StructurePython Programming: Data Structure
Python Programming: Data StructureChan Shik Lim
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88Mahmoud Samir Fayed
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)gekiaruj
 
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачиPython легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачиMaxim Kulsha
 
Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.Douglas Starnes
 
TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.lnikolaeva
 
The Ring programming language version 1.6 book - Part 84 of 189
The Ring programming language version 1.6 book - Part 84 of 189The Ring programming language version 1.6 book - Part 84 of 189
The Ring programming language version 1.6 book - Part 84 of 189Mahmoud Samir Fayed
 

What's hot (20)

Clips basics how to make expert system in clips | facts adding | rules makin...
Clips basics  how to make expert system in clips | facts adding | rules makin...Clips basics  how to make expert system in clips | facts adding | rules makin...
Clips basics how to make expert system in clips | facts adding | rules makin...
 
Understanding Lemon Generated Parser Final
Understanding Lemon Generated Parser FinalUnderstanding Lemon Generated Parser Final
Understanding Lemon Generated Parser Final
 
Event Stream Processing with Multiple Threads
Event Stream Processing with Multiple ThreadsEvent Stream Processing with Multiple Threads
Event Stream Processing with Multiple Threads
 
The Ring programming language version 1.3 book - Part 18 of 88
The Ring programming language version 1.3 book - Part 18 of 88The Ring programming language version 1.3 book - Part 18 of 88
The Ring programming language version 1.3 book - Part 18 of 88
 
Understanding Lemon Generated Parser
Understanding Lemon Generated ParserUnderstanding Lemon Generated Parser
Understanding Lemon Generated Parser
 
Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11Codice legacy, usciamo dal pantano! @iad11
Codice legacy, usciamo dal pantano! @iad11
 
The Ring programming language version 1.6 book - Part 34 of 189
The Ring programming language version 1.6 book - Part 34 of 189The Ring programming language version 1.6 book - Part 34 of 189
The Ring programming language version 1.6 book - Part 34 of 189
 
Introduction to Python and TensorFlow
Introduction to Python and TensorFlowIntroduction to Python and TensorFlow
Introduction to Python and TensorFlow
 
Python Programming: Data Structure
Python Programming: Data StructurePython Programming: Data Structure
Python Programming: Data Structure
 
Process management
Process managementProcess management
Process management
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88
 
Knight's Tour
Knight's TourKnight's Tour
Knight's Tour
 
Slides
SlidesSlides
Slides
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачиPython легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
 
Python_ 3 CheatSheet
Python_ 3 CheatSheetPython_ 3 CheatSheet
Python_ 3 CheatSheet
 
Haskell 101
Haskell 101Haskell 101
Haskell 101
 
Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.Data Science for Folks Without (or With!) a Ph.D.
Data Science for Folks Without (or With!) a Ph.D.
 
TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.
 
The Ring programming language version 1.6 book - Part 84 of 189
The Ring programming language version 1.6 book - Part 84 of 189The Ring programming language version 1.6 book - Part 84 of 189
The Ring programming language version 1.6 book - Part 84 of 189
 

Similar to Stacks

Data structures stacks
Data structures   stacksData structures   stacks
Data structures stacksmaamir farooq
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-listpinakspatel
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manualnikshaikh786
 
03 stacks and_queues_using_arrays
03 stacks and_queues_using_arrays03 stacks and_queues_using_arrays
03 stacks and_queues_using_arraystameemyousaf
 
Introduction to functions
Introduction to functionsIntroduction to functions
Introduction to functionsElkin Guillen
 
My lecture stack_queue_operation
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operationSenthil Kumar
 
Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...
Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...
Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...Paulo Miguel Almeida
 
Data structure lecture7
Data structure lecture7Data structure lecture7
Data structure lecture7Kumar
 
Stack linked list
Stack linked listStack linked list
Stack linked listbhargav0077
 

Similar to Stacks (20)

U3.stack queue
U3.stack queueU3.stack queue
U3.stack queue
 
Stack.pptx
Stack.pptxStack.pptx
Stack.pptx
 
Introduction to Erlang
Introduction to ErlangIntroduction to Erlang
Introduction to Erlang
 
Stack
StackStack
Stack
 
Data structures stacks
Data structures   stacksData structures   stacks
Data structures stacks
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manual
 
03 stacks and_queues_using_arrays
03 stacks and_queues_using_arrays03 stacks and_queues_using_arrays
03 stacks and_queues_using_arrays
 
stack-Intro.pptx
stack-Intro.pptxstack-Intro.pptx
stack-Intro.pptx
 
Note introductions of functions
Note introductions of functionsNote introductions of functions
Note introductions of functions
 
Introduction to functions
Introduction to functionsIntroduction to functions
Introduction to functions
 
My lecture stack_queue_operation
My lecture stack_queue_operationMy lecture stack_queue_operation
My lecture stack_queue_operation
 
Stacks, Queues, Deques
Stacks, Queues, DequesStacks, Queues, Deques
Stacks, Queues, Deques
 
Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...
Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...
Auckland Programming Algorithms and Performance Meetup about Stacks & LeetCod...
 
Lect-28-Stack-Queue.ppt
Lect-28-Stack-Queue.pptLect-28-Stack-Queue.ppt
Lect-28-Stack-Queue.ppt
 
Data structure lecture7
Data structure lecture7Data structure lecture7
Data structure lecture7
 
Stack linked list
Stack linked listStack linked list
Stack linked list
 
Lecture2
Lecture2Lecture2
Lecture2
 
DS MOD2 (1) (1).pptx
DS MOD2 (1) (1).pptxDS MOD2 (1) (1).pptx
DS MOD2 (1) (1).pptx
 
Stacks queues
Stacks queuesStacks queues
Stacks queues
 

Recently uploaded

PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxEduSkills OECD
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxMYDA ANGELICA SUAN
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphNetziValdelomar1
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxheathfieldcps1
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17Celine George
 

Recently uploaded (20)

PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quizFinals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
 
Patterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptxPatterns of Written Texts Across Disciplines.pptx
Patterns of Written Texts Across Disciplines.pptx
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a Paragraph
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17How to Add a many2many Relational Field in Odoo 17
How to Add a many2many Relational Field in Odoo 17
 

Stacks

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Implementing a Stack Using an Array (Contd.) 10 top = – 1 Stack 2 1 0 4 3 PUSH an element 3
  • 12. Implementing a Stack Using an Array (Contd.) 10 top = 0 Stack 2 1 0 4 3 top = 0 PUSH an element 3
  • 13. Implementing a Stack Using an Array (Contd.) 10 top = 0 10 Stack 2 1 0 4 3 3 Item pushed PUSH an element 3
  • 14. Implementing a Stack Using an Array (Contd.) 10 top = 0 10 Stack 2 1 0 4 3 3 PUSH an element 8
  • 15. Implementing a Stack Using an Array (Contd.) 10 top = 0 10 Stack 2 1 0 4 3 3 top = 1 PUSH an element 8
  • 16. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 top = 1 8 Item pushed PUSH an element 8
  • 17. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 top = 1 8 PUSH an element 5
  • 18. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 top = 1 8 top = 2 PUSH an element 5
  • 19. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 top = 2 5 Item pushed PUSH an element 5
  • 20. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 top = 2 5 PUSH an element 1
  • 21. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 top = 2 5 top = 3 PUSH an element 1
  • 22. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 top = 3 1 Item pushed PUSH an element 1
  • 23. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 top = 3 1 PUSH an element 9
  • 24. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 top = 3 1 top = 4 PUSH an element 9
  • 25. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 top = 4 9 Item pushed PUSH an element 9
  • 26. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 top = 4 9 PUSH an element 2
  • 27. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 top = 4 9 top = 5 PUSH an element 2
  • 28. Implementing a Stack Using an Array (Contd.) 10 10 Stack 2 1 0 4 3 3 8 5 1 9 top = 5 Stack overflow PUSH an element 2
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.

Editor's Notes

  1. To start the session, you need to get a set of playing cards in the class. Follow the instructions as given below to begin the game of Rummy. 1. The game begins by dealing a fixed number of cards to all players. The remaining cards are placed face down to form a “stock” pile. 2. There is also a face-up pile called the “discard” pile. 3. Initially, the discard pile contains only one card which is obtained by picking the topmost card from the stock pile. 4. Each player can draw either the topmost card of the stock pile or the topmost card on the discard pile to make a valid sequence in his/her hand. 5. After this, the player must discard one card on top of the discard pile. 6. The next player, can then draw either the topmost card of the draw pile or the topmost card of the discard pile. 7. Therefore, if a player has to draw a card from the discard pile, he/she can draw only the topmost card of the discard pile. 8. Similarly, when a player has to discard a card, he/she must discard it on the top of the discard pile. 9. The discard pile can therefore be considered a Last-In-First-Out list. 10. The last card placed on top of the discard pile is the first one to be drawn. 11. To represent and manipulate this kind of a discard pile in a computer program, you would like to use a list that: a. Contains the details of all the cards in the discard pile. b. Implements insertion and deletion of card details in such a way that the last inserted card is the first one to be removed. This kind of a list can be implemented by using a stack. Ask students to define a stack? Ask them to refer to the game and come up with some characteristics of a stack. Then come to next slide and give them the definition of stacks.
  2. You can give some more explanation of stacks by with the help of the following example. 1. A stack is like an empty box containing books, which is just wide enough to hold the books in one pile. 2. The books can be placed as well as removed only from the top of the box. 3. The book most recently put in the box is the first one to be taken out. 4. The book at the bottom is the first one to be put inside the box and the last one to be taken out.
  3. In this slide you need to show the calculation to determine the sum of an arithmetic progression for bubble sort algorithm. Refer to student guide.
  4. In this slide you need to show the calculation to determine the sum of an arithmetic progression for bubble sort algorithm. Refer to student guide.
  5. Tell students that stacks can be implemented using both arrays and Linked List. The slides to explain the implementation of stacks using an array are given.
  6. Make this session an interactive one by asking students to write an algorithm to implement POP operation using an array. Let students first try to write the algorithm. Then you can explain the algorithm given in the student guide. In addition, also explain the exception conditions that is encountered while popping an element from the stack, using an array.
  7. In this slide you need to show the calculation to determine the sum of an arithmetic progression for bubble sort algorithm. Refer to student guide.
  8. In this section, you need to discuss the applications of Stacks. In addition, to the given applications, you can discuss some real life applications also. For example, ask students to notice the operations in their Mobile phones. When you go to the Menu  log  Recent calls  Missed calls. On the missed call page, you will be able to view all the missed call number. To back to the main page, you need to press the back option and it will take you page, you last visited.
  9. In this section, you need to discuss the applications of Stacks. In addition, to the given applications, you can discuss some real life applications also. For example, ask students to notice the operations in their Mobile phones. When you go to the Menu  log  Recent calls  Missed calls. On the missed call page, you will be able to view all the missed call number. To back to the main page, you need to press the back option and it will take you page, you last visited.
  10. Explain this concept to students by further telling them that the changes are internally stored in the stack data structure inside the computer. The last change made is the first one to be reverted.
  11. In this slide, ask students to relate to the example they have learnt in the beginning of the session.
  12. This is one of the applications where stack is used. You need to run through the slides and then ask students to write an algorithm to check the correctness of the nested parenthesis. The algorithm will be: Scan the expression. Push the opening bracket into the stack. If a closing bracket is encountered, check if the closing bracket is same as the opening bracket. If this condition holds true, POP the corresponding opening bracket from the stack. If the condition is false, the expression is not a valid expression.
  13. In this slide, ask students to relate to the example they have learnt in the beginning of the session.