logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    sfolax6776
    Jan 15, 2019
      ·  Edited: Aug 31, 2019

    7-1 Why prefix or post fix notations are used in computers?

    in ACSL Contest Prep

    Prefix and postfix notations are also known as Polish notation and reverse Polish notation, in honor of the inventor's nationality. These notations are used as the syntax of mathematical expressions in programming languages because they do not need parenthesis therefore are easier and quicker to interpret.


    Steps to convert an infix notation into prefix or postfix:

    1. Fully parenthesize the infix expression. For example (2x + y) / (x-2y) becomes

    ( ( ( 2* x) +y) / (x - (2*y) ) )

    2. List all operands in the order of appearance:

    2 x y x 2 y

    3. Review and note down the order of precedence in the infix expression in step 1: *, +, *, -, /

    4. Follow the order in step 3, insert the operators before or after corresponding operands in step 2:

    prefix: *2 x y x 2 y -> +*2 x y x 2 y -> +*2 x y -x *2 y -> /+*2 x y -x *2 y

    postfix: 2 x* y x 2 y -> 2 x* y+ x 2 y -> 2 x* y+ x 2 y* - -> 2 x* y+ x 2 y*-/


    More examples in the videos on this page:

    http://www.categories.acsl.org/wiki/index.php?title=Prefix/Infix/Postfix_Notation


    We went through DraftPick in the class. Here is the link to the solution of ACSL_Search in case you are curious. We will go through this example this coming weekend.


    Your Challenges:

    Prefix/Postfix short questions: 1) #1 and #2 in 2014-15C2jr. 2) #1 and #2 in 2015-16C2jr.pdf

    Coding task: ACSL_Lisp_jr


    7 comments
    0
    danny481
    Jan 19, 2019

    up arrow: ! exponent: #


    2016

    1. 14/17!*+17*12-*12/-

    2. a*(b - c)!2/b - c/(a!2)


    2015

    1. +-/*2 + 12!6/6 + 3

    2. +-3 x#2 4 y 2 + x y#2 4 x 5 y+-


    0
    Davey Yu
    Jan 19, 2019  ·  Edited: Jan 20, 2019

    2014-2015 1.3 2.3x2^4y*-xy2^*2*4x*5y*/+ 2015-2016 1.108 2.-/*a^-bc2b/c^a2

    0
    mr.ricklu
    Jan 19, 2019

    1)

    1. 3

    2. 3x2^*4y*2xy2^+*4x*5x*/+-+

    2)

    1. 108

    2. abc-2^*b/ca2^/-

    0
    ultragumgaming27
    Jan 19, 2019

    2014-2015

    1) three

    2) 3 x^2 * 4 y * 2 - x y^2+ * 4 x +* 5 y * /

    2015-2016

    1) 352??

    2) - ^2 b c * a / b - ^2 / a c

    0
    yd89782
    Jan 19, 2019

    2014-15

    1. 3

    2. 3 x 2^* 4 y*+ 2 x*- 2 y 2^*+ 4 x*+ 5 y*/


    2015-16

    1. 23

    2. -/*a ^-b c 2 b /c ^a 2

    0
    wangernestrdragon
    Jan 19, 2019

    2014-2015

    1)3

    2)3x2^*4y*+xy2^2*-4x*5y*/+


    2015

    1)108

    2)b a b c - 2^*/ c a 2^/-

    0
    trjoshi3011
    Jan 20, 2019  ·  Edited: Jan 20, 2019

    2014-2015

    1. 3

    2.i didn't get how to do it:(

    2015-2016

    1.108????

    2.I have no idea about this one.

    0
    7 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners