Refresh to get another 5 random questions

Rotate a square matrix

Given a square matrix, can you make a clockwise or anti-clockwise rotation of this matrix by applying
two kinds of reflection operation on it? How about transpose?


Assignment problem

The assignment problem is one of the fundamental combinatorial optimization problems in the branch of optimization or operations research in mathematics. It consists of finding a maximum weight matching in ...


Inversions in permutation

An inversion of a permutation is a pair of elements that are out of order.
(a) Show that a permutation of n items has at most n(n-1)/2 inversions. Which permutation(s) ...


About flipping coins

Suppose that you toss a fair coin for N times. You will have a series like "
hthththhhhhttt...".
In this series V, if v(i)=v(i+1)=...v(i+n) AND v(i-m)=...=v(i-2)=v(i-1)!= v(
i) it is ...


Find the missing number

An array A[1..n] contains all the integers from 0 to n except one. It
would be easy to determine the missing integer in O(n) time by using an
auxilary array ...