Joined May 2012
Photos and videos
D(n) is the number of permutations of {1,2,...,n} such that for all 1<=k<=n, k doesn't appear in the k-th position. What is D(n)?
3
Given an array of N real numbers, design an N log N algorithm that determines whether any two of them sum to zero.
2
Explain how to solve the bipartite matching problem by reducing it to a max flow problem.
5
All science is either physics or stamp collecting. - Ernest Rutherford.
7
Assuming elements are uniformly distributed, what is the expectation number of swaps in insertion sort?
4
B(n) is the number of ways that {1,2,...,n} can be partitioned into nonempty subsets. What is B(10)?
1
Given an array of N numbers, design O(n) algorithm that identifies a majority(i.e, an element that appears more than N/2 times).
2
Implement a stack that returns minimum value in O(1) time.
1
Given an array of N real numbers, design an N log N algorithm that finds a local minimum (index i such that a[i-1] < a[i] < a[i 1]).
1
Random numbers should not be generated with a method chosen at random. - Donald Knuth
7
D(n) is the number of permutations of {1,2,...,n} such that for all 1<=k<=n, k doesn't appear in the k-th position. What is D(n)?
1
Given an array of N real numbers, design an N log N algorithm that determines whether any two of them sum to zero.
2
Implement a queue using two stacks.
1
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is. - John von Neumann
6
Explain how to solve the bipartite matching problem by reducing it to a max flow problem.
3
All science is either physics or stamp collecting. - Ernest Rutherford.
5
B(n) is the number of ways that {1,2,...,n} can be partitioned into nonempty subsets. What is B(10)?
2
Assuming elements are uniformly distributed, what is the expectation number of swaps in insertion sort?
4
Implement a queue using two stacks.
1
Given an array of N numbers, design O(n) algorithm that identifies a majority(i.e, an element that appears more than N/2 times).
2