{"componentChunkName":"component---src-templates-blog-post-jsx","path":"/blogs/infixPrefixPostfixExpressions","result":{"data":{"blog":{"frontmatter":{"title":"INFIX, POSTFIX, PREFIX EXPRESSIONS","thumbnail":"blog28","date":"December 16, 2020","dsaCppCodeFile":null},"excerpt":"<div class=\"my-2 p-2\">\n              <h4>What is an Expression?</h4>\n              <p>\n                An Expression is a combination of operands (that can be numbers\n                constants, variables), operators and symbols of\n                grouping(brackets, curly braces) written is a specific\n                format/way.\n              </p>\n            </div>\n            <div class=\"my-2 p-2\">\n              <h4>Types</h4>\n              <p>\n                Depending on how the expression is written, we can classify it\n                into 3 types:\n              </p>\n              <ol class=\"pl-4\">\n                <li>\n                  <strong>Infix Expression:</strong>\n                  Expression in which the operator appears in between the\n                  operands and it is simply of the form (operand1 operator\n                  operand2). <br />\n                  E.g. A+B\n                </li>\n                <li>\n                  <strong>Postfix Expression:</strong>\n                  Expression in which the operator appears after the operands\n                  and it is simply of the form (operand1 operand2 operator).\n                  <br />\n                  E.g. AB+\n                </li>\n                <li>\n                  <strong>Prefix Expression:</strong>\n                  Expression in which the operator appears before the operands\n                  and is simply of the form (operator operand1 operand2). <br />\n                  E.g. +AB\n                </li>\n              </ol>\n            </div>\n            <div class=\"my-2 p-2\">\n              <h4>Order of Precedence & Associativity</h4>\n              <div class=\"table-responsive\">\n                <table class=\"table table-striped\">\n                  <caption class=\"text-center\">\n                    Precedence & Associativity\n                  </caption>\n                  <thead class=\"thead-dark\">\n                    <tr>\n                      <th>Precedence</th>\n                      <th>Name</th>\n                      <th>Sybmols</th>\n                      <th>Associativity</th>\n                    </tr>\n                  </thead>\n                  <tbody>\n                    <tr>\n                      <th>1</th>\n                      <th>Parentheses</th>\n                      <th>{ } [ ] ( )</th>\n                      <th>Same</th>\n                    </tr>\n                    <tr>\n                      <th>2</th>\n                      <th>Exponent</th>\n                      <th>^</th>\n                      <th>Right to Left</th>\n                    </tr>\n                    <tr>\n                      <th>3</th>\n                      <th>Division & Multiplication</th>\n                      <th>/ *</th>\n                      <th>Left to Right</th>\n                    </tr>\n                    <tr>\n                      <th>4</th>\n                      <th>Addition & Subraction</th>\n                      <th>+ -</th>\n                      <th>Left to Right</th>\n                    </tr>\n                  </tbody>\n                </table>\n              </div>\n            </div>\n            <div class=\"my-2 p-2\">\n              <h4>Need of these expressions</h4>\n              <div class=\"m-2\">\n                <p>\n                  Infix expressions are human readable but not efficient for\n                  machine reading. Prefix and Postfix expressions do not need\n                  the concept of precedence & associativity hence it becomes\n                  highly efficient to parse expressions in prefix or postfix\n                  formats.\n                </p>\n                <p>\n                  Will study the conversion of one type to another type &\n                  evaluation of expressions in seperate blog posts along with\n                  implemention using C++.\n                </p>\n              </div>\n            </div>\n            <div class=\"my-2 p-2\">\n              <strong>Similar posts:</strong>\n              <a href=\"/blogs/stack\">Stack</a>\n              |\n              <a href=\"/blogs/infixToPostfix\">Infix to Postfix</a>\n              |\n              <a href=\"/blogs/infixToPrefix\">Infix to Prefix</a>\n              |\n              <a href=\"/blogs/evaluationOfPostfix.html\"\n                >Evaluation of Postfix & Prefix Expressions</a\n              >\n            </div>\n","html":"<div class=\"my-2 p-2\">\n              <h4>What is an Expression?</h4>\n              <p>\n                An Expression is a combination of operands (that can be numbers\n                constants, variables), operators and symbols of\n                grouping(brackets, curly braces) written is a specific\n                format/way.\n              </p>\n            </div>\n            <div class=\"my-2 p-2\">\n              <h4>Types</h4>\n              <p>\n                Depending on how the expression is written, we can classify it\n                into 3 types:\n              </p>\n              <ol class=\"pl-4\">\n                <li>\n                  <strong>Infix Expression:</strong>\n                  Expression in which the operator appears in between the\n                  operands and it is simply of the form (operand1 operator\n                  operand2). <br />\n                  E.g. A+B\n                </li>\n                <li>\n                  <strong>Postfix Expression:</strong>\n                  Expression in which the operator appears after the operands\n                  and it is simply of the form (operand1 operand2 operator).\n                  <br />\n                  E.g. AB+\n                </li>\n                <li>\n                  <strong>Prefix Expression:</strong>\n                  Expression in which the operator appears before the operands\n                  and is simply of the form (operator operand1 operand2). <br />\n                  E.g. +AB\n                </li>\n              </ol>\n            </div>\n            <div class=\"my-2 p-2\">\n              <h4>Order of Precedence & Associativity</h4>\n              <div class=\"table-responsive\">\n                <table class=\"table table-striped\">\n                  <caption class=\"text-center\">\n                    Precedence & Associativity\n                  </caption>\n                  <thead class=\"thead-dark\">\n                    <tr>\n                      <th>Precedence</th>\n                      <th>Name</th>\n                      <th>Sybmols</th>\n                      <th>Associativity</th>\n                    </tr>\n                  </thead>\n                  <tbody>\n                    <tr>\n                      <th>1</th>\n                      <th>Parentheses</th>\n                      <th>{ } [ ] ( )</th>\n                      <th>Same</th>\n                    </tr>\n                    <tr>\n                      <th>2</th>\n                      <th>Exponent</th>\n                      <th>^</th>\n                      <th>Right to Left</th>\n                    </tr>\n                    <tr>\n                      <th>3</th>\n                      <th>Division & Multiplication</th>\n                      <th>/ *</th>\n                      <th>Left to Right</th>\n                    </tr>\n                    <tr>\n                      <th>4</th>\n                      <th>Addition & Subraction</th>\n                      <th>+ -</th>\n                      <th>Left to Right</th>\n                    </tr>\n                  </tbody>\n                </table>\n              </div>\n            </div>\n            <div class=\"my-2 p-2\">\n              <h4>Need of these expressions</h4>\n              <div class=\"m-2\">\n                <p>\n                  Infix expressions are human readable but not efficient for\n                  machine reading. Prefix and Postfix expressions do not need\n                  the concept of precedence & associativity hence it becomes\n                  highly efficient to parse expressions in prefix or postfix\n                  formats.\n                </p>\n                <p>\n                  Will study the conversion of one type to another type &\n                  evaluation of expressions in seperate blog posts along with\n                  implemention using C++.\n                </p>\n              </div>\n            </div>\n            <div class=\"my-2 p-2\">\n              <strong>Similar posts:</strong>\n              <a href=\"/blogs/stack\">Stack</a>\n              |\n              <a href=\"/blogs/infixToPostfix\">Infix to Postfix</a>\n              |\n              <a href=\"/blogs/infixToPrefix\">Infix to Prefix</a>\n              |\n              <a href=\"/blogs/evaluationOfPostfix.html\"\n                >Evaluation of Postfix & Prefix Expressions</a\n              >\n            </div>"},"thumbnail":{"childImageSharp":{"fluid":{"tracedSVG":"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='400'%20height='225'%20viewBox='0%200%20400%20225'%20preserveAspectRatio='none'%3e%3cpath%20d='M24%2090l-1%2012-1%208h11v-9l2%204c2%204%203%205%205%205s2%200%202-9%200-10-2-10c-1%200-2%201-2%203l-1%204-1-4c-1-2-2-3-4-3-3%200-3%200-3%205l-1%206v-6c0-5%200-6-2-6h-2m25%201c-5%200-6%201-6%2013%200%206%200%206%203%206%202%200%202%200%202-3s0-3%203-4c2%200%203-1%203-2%200-2-1-2-3-2-5%200-4-3%201-3l4-3c0-2%200-3-7-2m9-1l-2%2012v8h5c6%200%206%200%207-3l1-2%202%202c0%202%202%203%203%203%202%200%202%200%200-6-1-4-1-4%201-8%202-3%202-3%201-5-2-1-2-1-4%201-2%203-2%203-3%201s-3-3-5-1c-1%201%200%202%201%205l2%203-2%204-3%204v-9c0-9%200-9-2-9h-2m38%201l-2%206-1%204-1-5c-1-4-2-5-4-5s-2%200%200%2011c1%207%202%208%204%208s3%200%205-9l3-9-4-1m43%202c-3%204-4%2011-1%2014%204%206%2011%202%2012-7%201-8-6-13-11-7m29-2l-5%201h-1c-2-2-8-1-9%201-3%203-2%206%201%208%204%204%204%205%200%205h-3c-2%204%207%205%2010%202s3-5-1-8l-3-5h1c1%202%204%203%205%202l3-1c2%200%202%200%202%207-1%207-1%207%202%207%202%200%203-4%203-12%200-2%200-3%202-3l2-2c0-2-1-3-2-3l-7%201m16%200c-6%200-6%200-6%2010%200%208%200%209%202%209s2%200%202-3%200-3%204-4c4%200%205-4%200-4-4%200-4-3%201-4%202%200%203-1%203-2v-2h-6m22%202l-1%202-1-2c-1-2-3-3-5-1-1%201-1%201%201%204l2%204-3%204c-3%206-3%206%200%206%202%200%203-1%204-3l1-2%201%202c1%202%202%203%204%203s2%200%200-5l-2-5%203-3c2-5%202-5%200-6-1-1-2%200-4%202m-102%200c-3%202-2%207%201%209%204%203%204%204%200%204-3-1-5%201-2%203%204%203%2010%200%2010-5l-3-5-3-4%202%201c2%203%204%201%204-2-1-3-7-4-9-1m19-1l-1%2010c0%208%200%208%202%208s3-1%203-3%201-3%203-4c5-1%207-5%205-9-2-3-9-4-12-2m145%2010c-3%203-5%2013-3%2017%201%202%204%203%205%201%201-1-1-9-3-10-4-1%202-9%208-9%207%200%209%205%206%2011-2%205-2%208%200%209%204%201%207-8%204-9l-1-4c0-8-10-12-16-6m31%204l-1%208v7h17l-5%205a66%2066%200%2000-19%2037l-2%2010v1l6-7c7-9%2017-15%2017-10%200%202%201%203%203%203s3-1%201-2l-1-3h4c3%200%202%201%200%204l-2%204v3h-17v7c0%206%200%207-2%208-3%202-3%203%200%203%202%200%203%204%201%206l-6%201c-9%200-11-4-7-9l2-5c0-3-8%206-8%2010-1%203-1%203-10%204-8%200-8%200-8%202s1%203%205%203c5%200%206%200%204%205-1%202%201%202%2048%202h49l1-4c1-2%202-3%205-3%205-1%205-4%200-5h-3v-14c0-14-1-21-4-21l-2-2-1-2c-7-1-7-4-3-12%207-13%207-17%200-22-4-3-5-4-5-8l-1-4c-1-1-1%201-1%204%200%205%200%205-2%204l-23%201-3%201v-10l-14-1-13%201m2%208v6h22v-13h-22v7M22%20125l3%209c1%209%201%209%204%208%203%200%209-17%207-18-3-2-4-1-5%204l-2%205-1-5c-1-4-2-5-4-5s-2%200-2%202m18%201c-3%203-3%205%201%208s4%204%201%204c-4-1-5%201-4%203%202%202%208%201%2010-1%203-2%202-5-1-8l-2-2h2c2%200%203%200%203-2%200-5-6-7-10-2m21-2c-2%200-2%201-2%2015-1%205%203%205%204%201%200-2%201-3%203-3%205-2%208-9%204-12-2-2-4-2-9-1m14%200l-2%209c0%209%200%209%202%209l2-1%201-5c1%200%202%201%202%203%202%203%203%203%205%202v-3c-1-3-1-4%201-6v-6c-2-3-8-4-11-2m14%200l-1%209v9h6c6%200%207-1%207-2%200-2-1-3-4-3-5%200-5-2-1-2%204-1%204-5%200-5l-3-1%204-1c4%200%204%200%204-2%200-3%200-3-6-3l-6%201m14%201l-1%2010c0%207%200%207%203%207%202%200%202%200%202-3s0-3%203-3%203%200%203-2c0-3%200-3-3-3-5%200-4-3%201-3%203%200%204-1%204-3%200-3-11-3-12%200m21-1c-2%201-2%201%200%205l2%204-3%204c-3%204-3%205%200%205%201%201%203%200%204-2%202-2%202-2%202%200l4%202c2%200%202%200%200-5l-2-4%203-4c2-3%202-4%200-5-1-1-1-1-3%201l-2%202-2-2c-1-1-2-2-3-1m146%2017l1%209h12v-18h-13v9m55%2016c0%201-1%202-3%202s-2%201-2%204v3h6c9%200%209%200%208%207l1%208v2l-1%203c0%204%200%204%205%204%207%201%2010-1%207-7v-5l-1-3-3-5-1-3h-1v-2l-3-5c-1-2-3-3-7-4l-5-2v3m-52%207l-1%205c0%203%200%204-1%203%200-4-2-3-3%200l2%204%202%203%203%201c2%200%202%200%202-3%200-2%200-3%202-3s2-1%202-4l-1-4-1%203c0%204-2%203-2-2-1-3-1-4-4-3'%20fill='%23d3d3d3'%20fill-rule='evenodd'/%3e%3c/svg%3e","aspectRatio":1.7699115044247788,"src":"/static/3df33522dc5c7ae1a4931a4713843172/ee604/blog28.png","srcSet":"/static/3df33522dc5c7ae1a4931a4713843172/69585/blog28.png 200w,\n/static/3df33522dc5c7ae1a4931a4713843172/497c6/blog28.png 400w,\n/static/3df33522dc5c7ae1a4931a4713843172/ee604/blog28.png 800w,\n/static/3df33522dc5c7ae1a4931a4713843172/f3583/blog28.png 1200w,\n/static/3df33522dc5c7ae1a4931a4713843172/e4d72/blog28.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}}},"pageContext":{"blog":"infixPrefixPostfixExpressions","thumbnail":"thumbnails/blog28.png"}},"staticQueryHashes":["2987289216","63159454"]}