SlideShare a Scribd company logo
Evaluation Expression
Steve Paks
Curriculum Model

A

A

A

A

A

CS

Here I am
A

A

A

CS
A
Java Language Base

CS : Computer
Science
A : Application
EVALUATION OF
EXPRESSIONS
• Evaluation expression
– We will pick the first one among the following answers.

x = a/b-c+d*e-a*c
a=4, b=c=2, d=e=3
((4/2)-2)+(3*3)-(4*2) = 0+9-8 = 1
or
(4/2-2+3))*(3-4)*2 = (4/3)*(-1)*2 = -2.6666…
– The same precedence have left-to-right associativity.

a*b/c%d/e is equivalent to ((((a*b)/c)%d)/e)
EVALUATION OF
EXPRESSIONS(Cont’d)
• Evaluation Postfix Expression
– The standard way of expression is infix notation.
– But, compiler does not use it.
Infix

Postfix

2+3*4
a*b+5
(1+2)*7
a*b/c
((a/(b-c+d))*(e-a)*c
a/b-c+d*e-a*c

234*+
ab*5+
12+7*
ab*c/
abc–d+/ea-*c*
ab/c–de*+ac*-
EVALUATION OF
EXPRESSIONS(Cont’d)
• Evaluation Postfix Expression(Cont’d)
– To evaluate an expression

Postfix Expression 62/3-42*+
Token
6
2
/
3
4
2
*
+

Stack
[0]
6
6
6/2
6/2
6/2-3
6/2-3
6/2-3
6/3-3
6/2-3+4*2

Top
[1]

[2]

2
3
4
4
4*2

2

0
1
0
1
0
1
2
1
0
EVALUATION OF
EXPRESSIONS(Cont’d)
• Infix to Postfix
– Algorithm

1. Fully parenthesize the expression.
2. Move all binary operators
so that they replace their corresponding right parentheses.
3. Delete all parentheses.
((((a/b)-c)+(d*e))-a*c)) → ((((ab/-c)+(d*e))-a*c))
((((ab/-c)+(d*e))-a*c)) → ((((ab/c-+(d*e))-a*c))
((((ab/c-+(d*e))-a*c)) → ((((ab/c-+(de*)-a*c))
((((ab/c-+(de*)-a*c)) → ((((ab/c-(de*+-a*c))
((((ab/c-(de*+-a*c)) ((((ab/c-(de*+-ac*)
((((ab/c-(de*+-ac*) ((((ab/c-(de*+ac*ab/c-de*+ac*-
EVALUATION OF
EXPRESSIONS(Cont’d)
• Infix to Postfix(Cont’d)
– Example 1
Token
a
+
b
*
c
eos

Stack
[0]
+
+
+
+

Top
[1]

*
*

Output

-1
0
0
1
1
-1

a
a
ab
ab
abc
abc*-

[2]
EVALUATION OF
EXPRESSIONS(Cont’d)
• Infix to Postfix(Cont’d)
– Example 2
Token
a
*
(
b
+
c
)
*
d
eos

Stack
[0]
*
*
*
*
*
*
*
*

Top
[1]

(
(
(
(

Output

-1
0
1
1
2
2
0
0
0
0

a
a
a
ab
ab
abc
abc+
abc+*
abc+*d
abc+*d*

[2]

+
+

More Related Content

What's hot

Database Management System-session 3-4-5
Database Management System-session 3-4-5Database Management System-session 3-4-5
Database Management System-session 3-4-5
Infinity Tech Solutions
 
Math Functions in C Scanf Printf
Math Functions in C Scanf PrintfMath Functions in C Scanf Printf
Math Functions in C Scanf Printf
yarkhosh
 
Programming with matlab session 3 notes
Programming with matlab session 3 notesProgramming with matlab session 3 notes
Programming with matlab session 3 notes
Infinity Tech Solutions
 
Dag representation of basic blocks
Dag representation of basic blocksDag representation of basic blocks
Dag representation of basic blocks
Jothi Lakshmi
 
Lecture three
Lecture threeLecture three
Lecture three
Mahmoud Hussein
 
Syntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address CodeSyntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address Code
sanchi29
 
Type Script 3.x - Was war. Was kommt!
Type Script 3.x - Was war. Was kommt!Type Script 3.x - Was war. Was kommt!
Type Script 3.x - Was war. Was kommt!
Johannes Dienst
 
The Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneThe Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhone
James Long
 
Introduction To Algorithm [2]
Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]ecko_disasterz
 
Intermediate code
Intermediate codeIntermediate code
Intermediate code
Vishal Agarwal
 
Main topic 3 problem solving and office automation
Main topic 3 problem solving and office automationMain topic 3 problem solving and office automation
Main topic 3 problem solving and office automation
Infinity Tech Solutions
 
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Peng Cheng
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
Rc Os
 

What's hot (15)

Database Management System-session 3-4-5
Database Management System-session 3-4-5Database Management System-session 3-4-5
Database Management System-session 3-4-5
 
Math Functions in C Scanf Printf
Math Functions in C Scanf PrintfMath Functions in C Scanf Printf
Math Functions in C Scanf Printf
 
Programming with matlab session 3 notes
Programming with matlab session 3 notesProgramming with matlab session 3 notes
Programming with matlab session 3 notes
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Syntaxdirected
 
Dag representation of basic blocks
Dag representation of basic blocksDag representation of basic blocks
Dag representation of basic blocks
 
Lecture three
Lecture threeLecture three
Lecture three
 
Syntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address CodeSyntax-Directed Translation into Three Address Code
Syntax-Directed Translation into Three Address Code
 
Type Script 3.x - Was war. Was kommt!
Type Script 3.x - Was war. Was kommt!Type Script 3.x - Was war. Was kommt!
Type Script 3.x - Was war. Was kommt!
 
The Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhoneThe Scheme Language -- Using it on the iPhone
The Scheme Language -- Using it on the iPhone
 
Introduction To Algorithm [2]
Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]
 
Intermediate code
Intermediate codeIntermediate code
Intermediate code
 
Lab no.08
Lab no.08Lab no.08
Lab no.08
 
Main topic 3 problem solving and office automation
Main topic 3 problem solving and office automationMain topic 3 problem solving and office automation
Main topic 3 problem solving and office automation
 
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
Shape Safety in Tensor Programming is Easy for a Theorem Prover -SBTB 2021
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
 

Similar to Evaluation expression

LET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERSLET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERS
KavyaSharma65
 
Sept. 15, 2014
Sept. 15, 2014Sept. 15, 2014
Sept. 15, 2014khyps13
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
machine_learning.pptx
machine_learning.pptxmachine_learning.pptx
machine_learning.pptx
Panchami V U
 
10b- Rabin Karp String Matching Problem.pptx
10b- Rabin Karp String Matching Problem.pptx10b- Rabin Karp String Matching Problem.pptx
10b- Rabin Karp String Matching Problem.pptx
AOUNHAIDER7
 
Lesson 1 see lesson plans
Lesson 1   see lesson plansLesson 1   see lesson plans
Lesson 1 see lesson plansAngela Phillips
 
lec4.ppt
lec4.pptlec4.ppt
lec4.ppt
NanoSana
 
Order of operations
Order of operationsOrder of operations
Order of operations
formatic20
 
Numerical Methods for Engineers 6th Edition Chapra Solutions Manual
Numerical Methods for Engineers 6th Edition Chapra Solutions ManualNumerical Methods for Engineers 6th Edition Chapra Solutions Manual
Numerical Methods for Engineers 6th Edition Chapra Solutions Manual
webavaq
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
aboma2hawi
 
Ezmath
EzmathEzmath
Module For Mathematics
Module For Mathematics Module For Mathematics
Module For Mathematics
jrbt2014
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
JAYAPRIYAR7
 
Java Bytecodes by Example
Java Bytecodes by ExampleJava Bytecodes by Example
Java Bytecodes by Example
Ganesh Samarthyam
 
Dat 305 dat305 dat 305 education for service uopstudy.com
Dat 305 dat305 dat 305 education for service   uopstudy.comDat 305 dat305 dat 305 education for service   uopstudy.com
Dat 305 dat305 dat 305 education for service uopstudy.com
ULLPTT
 
Special topics about stocks and bonds using algebra
Special topics about stocks and bonds using algebraSpecial topics about stocks and bonds using algebra
Special topics about stocks and bonds using algebra
RomualdoDayrit1
 

Similar to Evaluation expression (20)

LET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERSLET US C (5th EDITION) CHAPTER 1 ANSWERS
LET US C (5th EDITION) CHAPTER 1 ANSWERS
 
Sept. 15, 2014
Sept. 15, 2014Sept. 15, 2014
Sept. 15, 2014
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
 
machine_learning.pptx
machine_learning.pptxmachine_learning.pptx
machine_learning.pptx
 
Lec19
Lec19Lec19
Lec19
 
10b- Rabin Karp String Matching Problem.pptx
10b- Rabin Karp String Matching Problem.pptx10b- Rabin Karp String Matching Problem.pptx
10b- Rabin Karp String Matching Problem.pptx
 
random test
random testrandom test
random test
 
Lesson 1 see lesson plans
Lesson 1   see lesson plansLesson 1   see lesson plans
Lesson 1 see lesson plans
 
lec4.ppt
lec4.pptlec4.ppt
lec4.ppt
 
Order of operations
Order of operationsOrder of operations
Order of operations
 
Numerical Methods for Engineers 6th Edition Chapra Solutions Manual
Numerical Methods for Engineers 6th Edition Chapra Solutions ManualNumerical Methods for Engineers 6th Edition Chapra Solutions Manual
Numerical Methods for Engineers 6th Edition Chapra Solutions Manual
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
 
Chap01
Chap01Chap01
Chap01
 
Ezmath
EzmathEzmath
Ezmath
 
Module For Mathematics
Module For Mathematics Module For Mathematics
Module For Mathematics
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
 
Java Bytecodes by Example
Java Bytecodes by ExampleJava Bytecodes by Example
Java Bytecodes by Example
 
Dat 305 dat305 dat 305 education for service uopstudy.com
Dat 305 dat305 dat 305 education for service   uopstudy.comDat 305 dat305 dat 305 education for service   uopstudy.com
Dat 305 dat305 dat 305 education for service uopstudy.com
 
Special topics about stocks and bonds using algebra
Special topics about stocks and bonds using algebraSpecial topics about stocks and bonds using algebra
Special topics about stocks and bonds using algebra
 
Syntaxdirected
SyntaxdirectedSyntaxdirected
Syntaxdirected
 

More from Jonghoon Park

Equivalence relations
Equivalence relationsEquivalence relations
Equivalence relationsJonghoon Park
 
Dynamically linked queues
Dynamically linked queuesDynamically linked queues
Dynamically linked queuesJonghoon Park
 
Dynamically linked stacks
Dynamically linked stacksDynamically linked stacks
Dynamically linked stacksJonghoon Park
 
Hemilton cycle circuit
Hemilton cycle circuitHemilton cycle circuit
Hemilton cycle circuitJonghoon Park
 
Min inconmensurable weight
Min inconmensurable weightMin inconmensurable weight
Min inconmensurable weightJonghoon Park
 

More from Jonghoon Park (14)

8150.graphs
8150.graphs8150.graphs
8150.graphs
 
Equivalence relations
Equivalence relationsEquivalence relations
Equivalence relations
 
Sparse matrices
Sparse matricesSparse matrices
Sparse matrices
 
Polynomials
PolynomialsPolynomials
Polynomials
 
Dynamically linked queues
Dynamically linked queuesDynamically linked queues
Dynamically linked queues
 
Dynamically linked stacks
Dynamically linked stacksDynamically linked stacks
Dynamically linked stacks
 
Singly linked lists
Singly linked listsSingly linked lists
Singly linked lists
 
Maze
MazeMaze
Maze
 
Sdoku
SdokuSdoku
Sdoku
 
N queen
N queenN queen
N queen
 
Hemilton cycle circuit
Hemilton cycle circuitHemilton cycle circuit
Hemilton cycle circuit
 
Good numbers
Good numbersGood numbers
Good numbers
 
Min inconmensurable weight
Min inconmensurable weightMin inconmensurable weight
Min inconmensurable weight
 
Garden for princess
Garden for princessGarden for princess
Garden for princess
 

Recently uploaded

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

Evaluation expression

  • 2. Curriculum Model A A A A A CS Here I am A A A CS A Java Language Base CS : Computer Science A : Application
  • 3. EVALUATION OF EXPRESSIONS • Evaluation expression – We will pick the first one among the following answers. x = a/b-c+d*e-a*c a=4, b=c=2, d=e=3 ((4/2)-2)+(3*3)-(4*2) = 0+9-8 = 1 or (4/2-2+3))*(3-4)*2 = (4/3)*(-1)*2 = -2.6666… – The same precedence have left-to-right associativity. a*b/c%d/e is equivalent to ((((a*b)/c)%d)/e)
  • 4. EVALUATION OF EXPRESSIONS(Cont’d) • Evaluation Postfix Expression – The standard way of expression is infix notation. – But, compiler does not use it. Infix Postfix 2+3*4 a*b+5 (1+2)*7 a*b/c ((a/(b-c+d))*(e-a)*c a/b-c+d*e-a*c 234*+ ab*5+ 12+7* ab*c/ abc–d+/ea-*c* ab/c–de*+ac*-
  • 5. EVALUATION OF EXPRESSIONS(Cont’d) • Evaluation Postfix Expression(Cont’d) – To evaluate an expression Postfix Expression 62/3-42*+ Token 6 2 / 3 4 2 * + Stack [0] 6 6 6/2 6/2 6/2-3 6/2-3 6/2-3 6/3-3 6/2-3+4*2 Top [1] [2] 2 3 4 4 4*2 2 0 1 0 1 0 1 2 1 0
  • 6. EVALUATION OF EXPRESSIONS(Cont’d) • Infix to Postfix – Algorithm 1. Fully parenthesize the expression. 2. Move all binary operators so that they replace their corresponding right parentheses. 3. Delete all parentheses. ((((a/b)-c)+(d*e))-a*c)) → ((((ab/-c)+(d*e))-a*c)) ((((ab/-c)+(d*e))-a*c)) → ((((ab/c-+(d*e))-a*c)) ((((ab/c-+(d*e))-a*c)) → ((((ab/c-+(de*)-a*c)) ((((ab/c-+(de*)-a*c)) → ((((ab/c-(de*+-a*c)) ((((ab/c-(de*+-a*c)) ((((ab/c-(de*+-ac*) ((((ab/c-(de*+-ac*) ((((ab/c-(de*+ac*ab/c-de*+ac*-
  • 7. EVALUATION OF EXPRESSIONS(Cont’d) • Infix to Postfix(Cont’d) – Example 1 Token a + b * c eos Stack [0] + + + + Top [1] * * Output -1 0 0 1 1 -1 a a ab ab abc abc*- [2]
  • 8. EVALUATION OF EXPRESSIONS(Cont’d) • Infix to Postfix(Cont’d) – Example 2 Token a * ( b + c ) * d eos Stack [0] * * * * * * * * Top [1] ( ( ( ( Output -1 0 1 1 2 2 0 0 0 0 a a a ab ab abc abc+ abc+* abc+*d abc+*d* [2] + +