Fisher-Yates shuffle Modern method. https://en.wikipedia.org/wiki/Fisher-Yates_shuffle#Modern_method 易于理解,从最后一个开始loop,在他之前(包括他本身)随便找一个,跟他swap。vector<int> shuffle(vector<int> a) {
fo...
Dot Product && Cross Product.In 2D-coordinate, we have two point A(x1,y1) and B(x2,y2);A·B = A*B*Cos(θ);A×B = x1*y2 - x2*y1;A×B means the parallelogram's area by line(O->A), line(O->B). Using...