Algorithm Interview Report
- 0of 0 votes
AnswersWrite code for computing binomial coefficient. E.g. "n choose k". Additional constraints are if "n choose k" is greater than 1 billion (1000000000), return -1, else return the answer. E.g. "40 choose 20" is > 1 billion, so you should return -1.
- May A November 19, 2013 in United States
Worse case expected time complexity is O(n * min(k, n-k)), and they had given worst case space complexity too, but I don't remember it.| Report Duplicate | Flag | PURGE
Algorithm C# - 0of 2 votes
AnswersYou are given an array A[] of N integers. The array is unsorted, and N integers can take any value from -2,147,483,647 to + 2,147,483,647. You are supposed to find index Q of a pivot point such that, for 0 <= i <= Q, A[i] <= A[Q], and for Q <= j < N, A[Q] <= A[j].
- May A November 19, 2013 in United States
If no such pivot point exists, you should return -1.
The expected worst case time complexity is O(N), and expected worst case space complexity (in addition to array A) is O(N).| Report Duplicate | Flag | PURGE
Algorithm C