Re: [algogeeks] question

2010-05-05 Thread Sathaiah Dontula
@vivek, Where do you store pairs sum ?, Space is O(N) ... :) Thanks, Sathaiah On Mon, May 3, 2010 at 9:03 PM, vivek bijlwan viv...@gmail.com wrote: copy the array(A) in a different array(B) to store the index info.(space O(n)) sort(A) take each pair's sum ( complexity O(n^2) ) and with

Re: [algogeeks] question

2010-05-05 Thread jalaj jaiswal
@ vivek sir thanks On Mon, May 3, 2010 at 9:03 PM, vivek bijlwan viv...@gmail.com wrote: copy the array(A) in a different array(B) to store the index info.(space O(n)) sort(A) take each pair's sum ( complexity O(n^2) ) and with that do a binary search for the 3rd element

Re: [algogeeks] Where does OS scheduling run??

2010-05-05 Thread Varun Nagpal
I guess with Virtual machines, instructions that simulate instructions of microprocessor are scheduled onto the real processor. But good question is how the scheduling of real microprocessor instructions done in a virtual machine. And the answer is again that its done on virtual processor, which

[algogeeks] Complexity of Algorithms

2010-05-05 Thread scanfile
Pls can anyone help me out that how to calculate the complexity of any Algorithm? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Re: a google question

2010-05-05 Thread Jitendra Kushwaha
@Varun output for your test cases are as below: arr1[0] + arr2[0] = 38 arr1[0] + arr2[1] = 33 arr1[1] + arr2[0] = 28 arr1[0] + arr2[0] = 38 arr1[0] + arr2[1] = 37 arr1[0] + arr2[2] = 36 what i was talking about worst case was that is if one have to find more than N elements of array c

Re: [algogeeks] question

2010-05-05 Thread Afroz Mohiuddin
Well if you want a sum of exactly 0 (or any constant) , there is an O(N^2) way Take your array, and hash it, note that it is always possible to hash a static set of keys so that the search/find in it is worst case O(1). This takes O(N) space, and time. Then over all the tuples of numbers in the

Re: [algogeeks] Where does OS scheduling run??

2010-05-05 Thread praba garan
Windows Task Manager Performance tab shows the presence of two processors. Will 2 instructions be executed concurrently?? With Regards, Prabagaran. On Wed, May 5, 2010 at 4:56 PM, Varun Nagpal varun.nagp...@gmail.comwrote: I guess with Virtual machines, instructions that simulate instructions