Xiao Bai tells stories, every day is wonderful.

Today xiaobai to bring you what story? No, we won’t tell stories today. Math today. ~ interesting

What is an order of magnitude

What the hell? Order of magnitude? Dizziness ^ V ^ ^ V ^ ^ V ^

Orders of magnitude

Passer-by a: Oh ~~, white originally you want to teach us to count.

Small white one old blood spurt out: above we saw, order of magnitude simple understanding, is used to describe the number behind 10 digit.

Passerby a: Wow, it’s so easy!

Continue to:

Order of magnitude and life

Passer-by a: It turns out that we can describe life with such an order of magnitude. I have a clue.

Xiaobai: actually technology comes from life. Let’s look at the order of magnitude comparison.

comparative

Passerby 1: The comparison is clear and easy to remember. Much easier to remember than those dead numbers.

Small white: you said to the point come up. Let xiao Bai sum up two points for everyone.

Conclusion:

  • Concrete numbers are used to record the objective world
  • Fuzzy numbers are used to understand the objective world

Count in and out

Let’s take a look at the following code:

function sum(a){
    returnDuce ((x,y) => x+y, 0)Copy the code

To summarize: An algorithm is a mapping of input to output.

Above xiao Bai mentioned a concept called scale. Let’s think about it. Resources are limited, so we definitely have to control and estimate the current scale.

The input size

Controlling the scale is important, for example React VirtualDOM needs to support ten thousand levels of data (we typically have a few thousand tags per page) and render in milliseconds to avoid stalling. You should have a number in mind

Today one

Once upon a time there was a little fairy, little white stop, stop, leave me a question!

// Write a function to determine whether the number of x in a string is equal to the number of O(regardless of case) : // XO("ooxx") = >true
// XO("xooxx") = >false
// XO("ooxXm") = >true
// XO("zpzpzpp") = >true// No x, no o, all equal, all 0 // XO("zzoo") = >false
Copy the code