# ACSL Contest 2

ACSL Jan 15, 2020

In ACSL Contest 2, you would face the questions covering the following three topics.

These topics would be covered in the following pages.

Next page: Pre/Post/Infix Notation

[latexpage]

## Pre/Post/Infix Notation

For this type of question, you would have to convert between different notations of expression or evaluate the expression provided. We would provide a brief introduction to the notations and then we will present the methods to covert them.

### Introduction to different notations

When the computer processes an expression, it could be expressed in three ways, which are called just as the top heading suggested. These different notations are connected with binary trees. In most cases, we are using the infix notation, in which the binary operators are placed between the two numbers. A basic example would be the following expression:

However, there are two other ways of presenting the notations. The first one is called prefix notation, in which the binary operators are placed in front of the two numbers. An example would be the following:

The other type would be postfix notation, in which the binary operators are placed at the end of the two numbers. An example would be this:

They seemed to be irrelevant at first glance, but, after I tell you about the conversion in the following sections, you would found that the above three examples are actually the same thing.

### Conversions between the different notations

When converting different notations, we often use the infix notation as a bridge during conversion. The following sections would show you how to present the different conversions.

#### Conversions between prefix and infix notations

When converting from prefix to infix notations, a good way would be trying to convert the sections which strictly follows the ‘`operator-number1-number2`‘ pattern. Let’s look at the following prefix expression example:

In order to convert this to infix notation, we could try to use the method I mentioned above. Notice that in most cases in ACSL, the \$\uparrow\$ represents the power function, where the first number is the base and the second is the exponential. So now let’s just get started. We would transverse the entire list of symbols until we reach finally an infix notation.

It might seem useful at first glance, but you would never be asked this type of question in the exam since its too easy. Instead, you would be asked to evaluate the prefix notation, which would be easier as you could use the result in every step instead. Let’s look at the following past paper question with its year indicated in the picture for Senior Contest.

To be honest, you could just follow the following steps to reach the results:

For the other way round, more questions occur as the infix notation could be quite complicated. Let’s look at the following example as a glance to how these type questions would be like:

At first glance, you might be scared by this question. But don’t panic. Just as the saying says, the best way to overcome the difficulty is to face it directly. Hence we could first try to remove the fraction lines and the square root symbols and convert them during the process. The following is the complete process during the expansion of the expression.

That’s all for converting between prefix and infix notations.

#### Converting between postfix and infix notations

When converting between postfix and infix notations, you would need basically the same skills as above, except always remember to look for `number1-number2-operator` when you are converting and put the operator at the back when you are converting to the postfix notations.

#### Converting between prefix and postfix notations

For this type of question, you could just use the infix notation as a bridge to convert.

Next Page: Bit-String Flicking

## Bit-String Flicking

There is basically a table of commands that you shall remember as the commands:

[latexpage]

## LISP Programming

For this part, you would have to remember the following function:

I’m truely sorry for the uncomplete of this post for the lack of time. The rest two sections only contains the most essential information. I might update this post during the holiday later.

Daniel – author of this post

#### Daniel Zhao

The greatest pigeon in SCIE who would always gugugu whenever, wherever, and whatever.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.