Re: [algogeeks] a google question

2010-05-02 Thread mohit ranjan
@Algoose Chase point taken Thanks Mohit Ranjan Samsung India Software Operations. On Sat, May 1, 2010 at 8:43 PM, Algoose Chase harishp...@gmail.com wrote: @mohit The idea of DP is fine. When you find the Max i dont think you need to include A[i+1]+B[j+1] because it can never be greater

Re: [algogeeks] 400!

2010-05-02 Thread divya jain
wat is tail recursion plz explan in detail On 2 May 2010 08:15, Rohit Saraf rohit.kumar.sa...@gmail.com wrote: @divya use tail recursion and rest should be fine.. -- -- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and

Re: [algogeeks] 400!

2010-05-02 Thread Rohit Saraf
google it... u will gt it i am on mobile... cannot explain now.. On 5/2/10, divya jain sweetdivya@gmail.com wrote: wat is tail recursion plz explan in detail On 2 May 2010 08:15, Rohit Saraf rohit.kumar.sa...@gmail.com wrote: @divya use tail recursion and rest should be fine.. --

Re: [algogeeks] a google question

2010-05-02 Thread vignesh radhakrishnan
@divya You're rite. Post a solution if you have one. -- Regards, Vignesh On 2 May 2010 13:14, divya jain sweetdivya@gmail.com wrote: @Mohit according to ur algo if a[1], b[0] has sum greater than a[0],b[1] then i is incremented i is now 2 so for next iteration u ll compare a[2] b[0]

Re: [algogeeks] 400!

2010-05-02 Thread vignesh radhakrishnan
I agree with abhijith. But given some very large x for which i would have to find factorial. I would either (i) use gmp in cpp or BigInteger or java if its not a lab exercise or an interview (ii) use simple brute multiplication algorithm. The second approach requires (a) The no. of digits

Re: [algogeeks] a google question

2010-05-02 Thread Shishir Mittal
This problem has been discussed before @ http://groups.google.co.in/group/algogeeks/browse_thread/thread/9c1e1aa8cf1ed437/d451cd9468d985f7 I believe, the problem can't be solved in O(n) but only in O(nlog n). @Divya: Are you sure the interviewer explicitly asked for an O(n) time algorithm? On

Re: [algogeeks] a google question

2010-05-02 Thread Algoose Chase
Hi will this work ? since we need Set S with n pairs of largest values , any such pair within the set would (always) contain A[0] or B[0] because they maximize the value of the pair. so // code snippet typedef std::vectorint,int Pairs; Pairs.push(A[0],B[0]) int i = 1; // index for ListA int j

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

2010-05-02 Thread praba garan
@ Pradeep *CPU stop its current processing and goes to the interrupt subroutine* you have mentioned that the CPU stops its current processing and goes to the interrupt subroutine.. My Question is how does the CPU stops its execution(any special hardware involved) because it is busy in executing

[algogeeks] Re: a google question

2010-05-02 Thread Satish
This problem can be simplified to a variation of merge part of merge sort algorithm. - Break the set S having n^2 values into n individual arrays of length n, say S1, S2,..Sn, where S1 = [a1+b1, a1+b2,...a1+bn]. - One can observe that each Si has entries which are themselves sorted within Si. -

[algogeeks] tree from linked list

2010-05-02 Thread divya
u are given a sorted lnked list construct a balanced binary search tree from it. -- 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] a google question

2010-05-02 Thread divya jain
i found this question on some site and it was mentioned there todo in o(n). i dont have the solution @ above ur solution doesnt include the case of ncluding a[i] b[j] it takes only a[i] b[0] or b[j] a[0] On 2 May 2010 18:11, Algoose Chase harishp...@gmail.com wrote: Hi will this work ?

Re: [algogeeks] 400!

2010-05-02 Thread Prasoon Mishra
I think challenge here is not the Execution time, but the storage. 300 ! or 400! should generally go beyond the storage capabilities of long long ints in cpp. @ Rohit Saraf: Hence, I don't know if even tail recursion will ultimately be able to store the output. I think Rajesh Patidar's answer fits

Re: [algogeeks] a google question

2010-05-02 Thread Algoose Chase
OOPs.. sorry this doesnt work ! On Sun, May 2, 2010 at 6:11 PM, Algoose Chase harishp...@gmail.com wrote: Hi will this work ? since we need Set S with n pairs of largest values , any such pair within the set would (always) contain A[0] or B[0] because they maximize the value of the pair.

Re: [algogeeks] a google question

2010-05-02 Thread Jitendra Kushwaha
Here is a solution of O(n) , taking 4 pointers 2 for each array #include cstdio #includeiostream using namespace std; #define N 10 int main(void) { int arr1[N] = {8,7,4,3,2,1,1,1,1,1}; int arr2[N] = {34,23,21,19,15,13,11,8,4,2}; int *p11,*p12,*p21,*p22; p11 = p12 = arr1;

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

2010-05-02 Thread CM Saikanth Varma
@Prabagaran Execution of an instruction, by the CPU, is an ATOMIC operation. Interrupts, if any, will be processed after the execution of the current instruction. CPU has interrupt pins attached to it. Whenever an interrupt occurs, the CPU will be informed about the interrupt through these

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

2010-05-02 Thread pradeep verma
we know that there are many pins available in microprocessor chips one of them is INTR(interrupt Req) When a CPU receives an Interrupt Request (IRQ), it first checks if it must react to the interrupt. So-called Maskable Interrupts allow a programmer to specify that the CPU does ignore it, while

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

2010-05-02 Thread harit agarwal
although CPU is busy in exexcution...it check's its registers values for the pending interrupts .. if any interrupt is pending at the end of the current CPU cycle...it shedules the interrupt handler to further execute the interrupt subroutine... -- You received this message because you are

[algogeeks] What happens when you double click a file??

2010-05-02 Thread praba garan
What happens when you double click a file?? (changes in Kernel DATA STRUCTURES and interrupts) With Regards, Prabagaran. -- 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