Calculator (double stack)
The pre-knowledges you should know is priority of operator. Priority is the rule that determines when we meet two operators, which to calculate first. Like 3+2*5, we calculate 2 * 5 first.
The priority of operators are:
The pre-knowledges you should know is priority of operator. Priority is the rule that determines when we meet two operators, which to calculate first. Like 3+2*5, we calculate 2 * 5 first.
The priority of operators are:
This is a rounding problem. Since it has only three number after the point, you just need to find the last number n and if it's more than four...
For me, the core of the problem is to figure out how the matches carry on exactly. It's the hardest part for me.
Last time I‘ve talked about how to build your own blog, however, the original theme might not very beautiful to you. So this time I would write how to change your blog theme and others.
This is a homework of Discrete Math course and it happened a long time ago. At first, I think of a violent way that is to list all the possible situations. Somehow, I still can’t achieve this because of my confusing logic. Then a friend of mine told me an algorithm that is Shunting Yard Algorithm.
Make sure all the code blocks highlighted correctly. All the code samples are come from the demo of https://highlightjs.org