## deam0n

BAN USERWe know that we can get many possible examples where multiplication or addition of n-numbers can be same as that of n other no.'s.

Why don't we use both multiplication and addition. I think I'm really tired b'coz it's really consuming my energy to think of such two different sets of n-no,s having same addition and multiplication (both). May be somebody can think them for me.

Not bothered abt special cases of 0 and 1.

Ex: 1 8 7 6 2 5 4 3

Take an auxiliary array. temp[]

Traverse first from left to right. We will count if for a given element arr[i] , there exist an element to its left which is less than it.

Keep track of min. element till i , and keep updating temp.

Now , traverse again from right to left. Here we will count that for a given elem arr[i] , there exists an element which is greater then it , on its right. Now as we see any value in temp is 2 , then we found our element.

multi-processes each with single thread.reasons:

1. each process will have dedicated CPU share. Its parallel processing , whereas 1 process with multiple threads is just an illusion of parallel processing.

2. no need for complex syncronization b/w processes , as each having its own address space.

3. one process damage will not halt entire processing.

Qs. doesn't tell any such specifics. Let me think on this.

Edit:

This problem can always be converted into finding kth elem in n=N/s(distibution size) sorted arrays.

But here we will not be able to take advantage of column-wise sorting scenario.May be someone can put more light on it.

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Interested ones get loaded with prep. and could mail their own resume to with subject and location is both Noida & Banglore.

- deam0n September 03, 2012