Re: [algogeeks] spoj

2012-02-13 Thread UTKARSH SRIVASTAV
not abe to get solution

On Mon, Feb 13, 2012 at 10:49 AM, atul anand atul.87fri...@gmail.comwrote:

 what problem are you facing ...???

 On Thu, Feb 9, 2012 at 12:01 PM, UTKARSH SRIVASTAV 
 usrivastav...@gmail.com wrote:

 I have been doing this question for a time but was not able to solve it.
 It is based  josephus problem ? Has anybody any idea
 http://www.spoj.pl/problems/WTK/
 --
 *UTKARSH SRIVASTAV
 CSE-3
 B-Tech 3rd Year
 @MNNIT ALLAHABAD*


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
*UTKARSH SRIVASTAV
CSE-3
B-Tech 3rd Year
@MNNIT ALLAHABAD*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2012-02-13 Thread Ratan
can any1 explain the working of the above expression in any of the
compiler. I jzz want to knw how the computation takes place in gcc
compiler..

On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan kartik.sac...@gmail.com wrote:
 its a compiler depentent...

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
--
Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2012-02-13 Thread Rahul
Here you go then :
++ i becomes 3
second bracket becomes 5 ( 3+2)


first bracket is 4

4 * 5 = 20
But you are adding ONE to i FOUR times
hence the answer you get is 4 plus the computation of previous line

Hope I AM correct :



On Mon, Feb 13, 2012 at 3:56 PM, Ratan success.rata...@gmail.com wrote:

 can any1 explain the working of the above expression in any of the
 compiler. I jzz want to knw how the computation takes place in gcc
 compiler..

 On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan kartik.sac...@gmail.com
 wrote:
  its a compiler depentent...
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.



 --
 --
 Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2012-02-13 Thread Ratan
Actually i had evaluated x=(++i + ++i); separately with i=2;
but i was amazed to get answer as 8... can u elaborate it

On Mon, Feb 13, 2012 at 4:09 PM, Rahul raikra...@gmail.com wrote:
 Here you go then :
 ++ i becomes 3
 second bracket becomes 5 ( 3+2)


 first bracket is 4

 4 * 5 = 20
 But you are adding ONE to i FOUR times
 hence the answer you get is 4 plus the computation of previous line

 Hope I AM correct :




 On Mon, Feb 13, 2012 at 3:56 PM, Ratan success.rata...@gmail.com wrote:

 can any1 explain the working of the above expression in any of the
 compiler. I jzz want to knw how the computation takes place in gcc
 compiler..

 On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan kartik.sac...@gmail.com
 wrote:
  its a compiler depentent...
 
  --
  You received this message because you are subscribed to the Google
  Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.



 --
 --
 Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
--
Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2012-02-13 Thread Azhar Hussain
C, standard says which operand belongs to which operator. It does not says
which one gets evaluated first.
Why it is returning 8 is because of sequence point. It tells that, all the
side effects of a value are resolved before an operation is performed.
In your case ++i + ++i evaluates like this on gcc 4.2
  ++2 which is 3
  ++3 which is 4
now sequence point is resolved both i + i is added to yield 8.
You should not use such expression

More information can be found at
http://c-faq.com/expr/seqpoints.html
http://en.wikipedia.org/wiki/Sequence_point

-
Azhar.

On Mon, Feb 13, 2012 at 7:38 PM, Ratan success.rata...@gmail.com wrote:

 Actually i had evaluated x=(++i + ++i); separately with i=2;
 but i was amazed to get answer as 8... can u elaborate it

 On Mon, Feb 13, 2012 at 4:09 PM, Rahul raikra...@gmail.com wrote:
  Here you go then :
  ++ i becomes 3
  second bracket becomes 5 ( 3+2)
 
 
  first bracket is 4
 
  4 * 5 = 20
  But you are adding ONE to i FOUR times
  hence the answer you get is 4 plus the computation of previous line
 
  Hope I AM correct :
 
 
 
 
  On Mon, Feb 13, 2012 at 3:56 PM, Ratan success.rata...@gmail.com
 wrote:
 
  can any1 explain the working of the above expression in any of the
  compiler. I jzz want to knw how the computation takes place in gcc
  compiler..
 
  On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan 
 kartik.sac...@gmail.com
  wrote:
   its a compiler depentent...
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
 
 
  --
  --
  Ratan | 3rd Year | Information Technology | NIT ALLAHABAD
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.



 --
 --
 Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2012-02-13 Thread Manikanta Babu
Azhar,

Thanks for the answer. Its a great explanation.

Cheers,
Mani

On Mon, Feb 13, 2012 at 7:50 PM, Azhar Hussain azhar...@gmail.com wrote:

 C, standard says which operand belongs to which operator. It does not says
 which one gets evaluated first.
 Why it is returning 8 is because of sequence point. It tells that, all the
 side effects of a value are resolved before an operation is performed.
 In your case ++i + ++i evaluates like this on gcc 4.2
   ++2 which is 3
   ++3 which is 4
 now sequence point is resolved both i + i is added to yield 8.
 You should not use such expression

 More information can be found at
 http://c-faq.com/expr/seqpoints.html
 http://en.wikipedia.org/wiki/Sequence_point

 -
 Azhar.


 On Mon, Feb 13, 2012 at 7:38 PM, Ratan success.rata...@gmail.com wrote:

 Actually i had evaluated x=(++i + ++i); separately with i=2;
 but i was amazed to get answer as 8... can u elaborate it

 On Mon, Feb 13, 2012 at 4:09 PM, Rahul raikra...@gmail.com wrote:
  Here you go then :
  ++ i becomes 3
  second bracket becomes 5 ( 3+2)
 
 
  first bracket is 4
 
  4 * 5 = 20
  But you are adding ONE to i FOUR times
  hence the answer you get is 4 plus the computation of previous line
 
  Hope I AM correct :
 
 
 
 
  On Mon, Feb 13, 2012 at 3:56 PM, Ratan success.rata...@gmail.com
 wrote:
 
  can any1 explain the working of the above expression in any of the
  compiler. I jzz want to knw how the computation takes place in gcc
  compiler..
 
  On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan 
 kartik.sac...@gmail.com
  wrote:
   its a compiler depentent...
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
 
 
  --
  --
  Ratan | 3rd Year | Information Technology | NIT ALLAHABAD
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.



 --
 --
 Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Thanks  Regards,
Mani
http://www.sanidapa.com - The music Search engine

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: how can we check for primality for very large number

2012-02-13 Thread Don
The elliptical curve method is one of the better ways to prove
primality for numbers which don't follow a special form.

A web applet to test numbers up to 10^200 or so.
http://www.alpertron.com.ar/ECM.HTM

Primo can prove very large numbers to be prime (or show them to be
composite). I have used it for numbers up to 10^3000, but others have
gone well beyond that.
http://www.ellipsa.net/

Don

On Feb 11, 8:52 am, rspr ravishanker@gmail.com wrote:
 How can we check for the primality fhttp://www.alpertron.com.ar/ECM.HTMor 
 very large number like 10^20 or
 more. It is not stored in integer So integer operation would not work
 on it.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2012-02-13 Thread Ratan
@azharr
+1  i got the concept ... thnxsss

On Mon, Feb 13, 2012 at 8:25 PM, Manikanta Babu
manikantabab...@gmail.com wrote:
 Azhar,

 Thanks for the answer. Its a great explanation.

 Cheers,
 Mani

 On Mon, Feb 13, 2012 at 7:50 PM, Azhar Hussain azhar...@gmail.com wrote:

 C, standard says which operand belongs to which operator. It does not says
 which one gets evaluated first.
 Why it is returning 8 is because of sequence point. It tells that, all the
 side effects of a value are resolved before an operation is performed.
 In your case ++i + ++i evaluates like this on gcc 4.2
           ++2 which is 3
           ++3 which is 4
 now sequence point is resolved both i + i is added to yield 8.
 You should not use such expression

 More information can be found at
 http://c-faq.com/expr/seqpoints.html
 http://en.wikipedia.org/wiki/Sequence_point

 -
 Azhar.


 On Mon, Feb 13, 2012 at 7:38 PM, Ratan success.rata...@gmail.com wrote:

 Actually i had evaluated x=(++i + ++i); separately with i=2;
 but i was amazed to get answer as 8... can u elaborate it

 On Mon, Feb 13, 2012 at 4:09 PM, Rahul raikra...@gmail.com wrote:
  Here you go then :
  ++ i becomes 3
  second bracket becomes 5 ( 3+2)
 
 
  first bracket is 4
 
  4 * 5 = 20
  But you are adding ONE to i FOUR times
  hence the answer you get is 4 plus the computation of previous line
 
  Hope I AM correct :
 
 
 
 
  On Mon, Feb 13, 2012 at 3:56 PM, Ratan success.rata...@gmail.com
  wrote:
 
  can any1 explain the working of the above expression in any of the
  compiler. I jzz want to knw how the computation takes place in gcc
  compiler..
 
  On Sun, Feb 12, 2012 at 11:03 PM, Kartik Sachan
  kartik.sac...@gmail.com
  wrote:
   its a compiler depentent...
  
   --
   You received this message because you are subscribed to the Google
   Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/algogeeks?hl=en.
 
 
 
  --
  --
  Ratan | 3rd Year | Information Technology | NIT ALLAHABAD
 
  --
  You received this message because you are subscribed to the Google
  Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
 
  --
  You received this message because you are subscribed to the Google
  Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from this group, send email to
  algogeeks+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.



 --
 --
 Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Thanks  Regards,
 Mani
 http://www.sanidapa.com - The music Search engine

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
--
Ratan | 3rd Year | Information Technology | NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] spoj

2012-02-13 Thread atul anand
what will the output of following input:
1) 1 2 3 4 5 6
2) 1 2 3 4 5 6 7

i am bit confused.because in the given link for input 2 ...output is
2but it should be written in this foam 2 1...
because 1 stands right of 2 so output should be 1...


On Mon, Feb 13, 2012 at 1:41 PM, UTKARSH SRIVASTAV
usrivastav...@gmail.comwrote:

 not abe to get solution


 On Mon, Feb 13, 2012 at 10:49 AM, atul anand atul.87fri...@gmail.comwrote:

 what problem are you facing ...???

 On Thu, Feb 9, 2012 at 12:01 PM, UTKARSH SRIVASTAV 
 usrivastav...@gmail.com wrote:

 I have been doing this question for a time but was not able to solve it.
 It is based  josephus problem ? Has anybody any idea
 http://www.spoj.pl/problems/WTK/
 --
 *UTKARSH SRIVASTAV
 CSE-3
 B-Tech 3rd Year
 @MNNIT ALLAHABAD*


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 *UTKARSH SRIVASTAV
 CSE-3
 B-Tech 3rd Year
 @MNNIT ALLAHABAD*


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: suggestions?

2012-02-13 Thread Don
How about a program to play a game such as Othello.
Each processor can work on scoring different moves, looking ahead
several moves, and then the final scores can be compared to select the
best move for the computer.
Don

On Feb 12, 9:58 am, Arun Vishwanathan aaron.nar...@gmail.com wrote:
 hi,

 I need to a final project in a course called Parallel Programming. Does
 anyone have suggestions for a good topic to take up in this??Some
 challenging problem maybe that is computationally intensive but can benefit
 from multicore and parallel processing.

 Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: kth largest element in two sorted arrays

2012-02-13 Thread Ashish Goel
Hello Venkat

One scenario that is troubling me is what if p2 is not a valid position in
l2?

findNth(start,end)
p1 = (start + end)/2
p2 = n-p1
if l1[p1]  l2[p2]:
if l1[p1 + 1]  l2[p2]:
return l2[p2]
else:
return findNth(p1+1, end)
else:
if l2[p2 + 1]  l1[p1]:
return l1[p1]
else:
return findNth(start,p1-1)

Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652


On Wed, Feb 1, 2012 at 11:41 AM, Venkat gvr.su...@gmail.com wrote:

 Hey Ashish check this link
 http://stackoverflow.com/questions/8999610/median-of-lists

 Thanks and Regards,
 Venkat Gottipati

 On Jan 31, 10:14 am, Ashish Goel ashg...@gmail.com wrote:
  i think this can be done much faster similar to findling median of two
  sorted arrays by proceeding with comparing medians of two arrays and then
  reducing the data set to approx 3/4th of 2n. I am looking for that algo
 if
  osmeone have.
 
  Best Regards
  Ashish Goel
  Think positive and find fuel in failure
  +919985813081
  +919966006652
 
 
 
 
 
 
 
  On Tue, Jan 31, 2012 at 9:26 AM, atul anand atul.87fri...@gmail.com
 wrote:
   to find kth largest element in the 2 sorted array can be done by simple
   merge...
   obv no need for extra space...two indexes will do.
 
   you just need to check arr1[i...n] == arr2[j..m]
 
   if(arr1[i]  arr2[j])
   {
  cnt++;
  index=arr2[j];
  j++;
 
   }
   else
   {
cnt++;
index=arr1[i];
i++;
 
   }
 
   if(k==cnt)
   {
 print  kthe largest element is at position arr[index]
   break;
   }
 
   On Tue, Jan 31, 2012 at 1:15 AM, Ashish Goel ashg...@gmail.com
 wrote:
 
   Hi,
 
   I am trying to write code for this problem but having issues.
   Can you help
 
   Best Regards
   Ashish Goel
   Think positive and find fuel in failure
   +919985813081
   +919966006652
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Algorithm page

2012-02-13 Thread Wladimir Tavares
Hi Guys,

I transfer some text for this blog.
http://marathoncode.blogspot.com

Some good posts:
http://marathoncode.blogspot.com/2012/01/rand8-usando-rand5.html
http://marathoncode.blogspot.com/2012/02/conhecimento-perigoso-parte-i.html
http://marathoncode.blogspot.com/2012/02/metaprogramacao-x-spoj.html
http://marathoncode.blogspot.com/2012/02/tutorial-sobre-xor.html
http://marathoncode.blogspot.com/2012/02/encontrar-o-menor-entre-dois-inteiros.html



Wladimir Araujo Tavares
*Federal University of Ceará http://lia.ufc.br/%7Ewladimir/
Homepage http://lia.ufc.br/%7Ewladimir/ |
Maratonahttps://sites.google.com/site/quixadamaratona/|
*




On Wed, Oct 5, 2011 at 7:11 PM, Wladimir Tavares wladimir...@gmail.comwrote:


 Hi Guys,

 I created this page to place some materials on algorithms. Suggestions are
 welcome.

 https://sites.google.com/site/quixadamaratona/

 Ps: The page is in Portuguese.

 Best wishes,



 *
 *




-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: find the sum of very large binary sequence in O(n)

2012-02-13 Thread Gene
What language are you using? In most languages a bool is either 1 byte
or 4 bytes long.  So you'd be wasting a tremendous amount of time and
space if you're doing the additions one bit at a time.

Here's roughly how it work work in C, but you'll get a faster result
with GNU mp on most machines because inner loops use assembly language
inserted to get access to the carry register.  My code is untested,
but ought to be at least very close.

typedef unsigned long long LIMB;
#define N_BITS 10
#define L sizeof(LIMB)
#define LIMB_SIZE ((N_BITS + L - 1) / L)

typedef struct big_num {
  LIMB bits[LIMB_SIZE];  // 12,500 long longs hold bits
} BIG_NUM;

// Add a and b. Put result in r. Return the carry out.
LIMB add(BIG_NUM *r, BIG_NUM *a, BIG_NUM *b)
{
  int i;
  LIMB c = 0;
  for (i = 0; i  LIMB_SIZE; i++) {
LIMB ia = a-bits[i];
LIMB ib = b-bits[i];
LIMB it = ia + ib;
LIMB ir = it + c;
r-bits[i] = ir;
c = (ir  it) || (it  ia);
  }
  return c;
}

On Feb 13, 2:12 am, rspr ravishanker@gmail.com wrote:
 I have two binary sequences x and y (10 bits long)...I am taking a
 bool array to store it.I have to implement the summation
 operation( at most 40 summation operation)...while the bits patter
 in changing in x and yin my approach before performing a sum I am
 taking care of a. to check is sequence A or B is changed b. is the sum
 operations are continuousso i have not to sum up it again bcz in
 between there is no change in A and B

 But the output is killingwhat could be the better approach to
 implement the sum operation.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Forums on android

2012-02-13 Thread kumar raja
This is an off topic , but because still i am in very need of it i am
asking.

i have joined in stackoverflow forum, but now it is not letting me to ask
questions as i have posted some inferior quality questions in it.
But i have asked a lot of questions because i am new to android coding.

now i am really in a  need of some forum/ good group which is interactive
and let me post my queries to get answers from geeks like this group.

please suggest me some of them.

-- 
Regards
Kumar Raja
M.Tech(SIT)
IIT Kharagpur,
10it60...@iitkgp.ac.in

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Forums on android

2012-02-13 Thread kumar raja
Reply me soon

On 14 February 2012 12:32, kumar raja rajkumar.cs...@gmail.com wrote:

 This is an off topic , but because still i am in very need of it i am
 asking.

 i have joined in stackoverflow forum, but now it is not letting me to ask
 questions as i have posted some inferior quality questions in it.
 But i have asked a lot of questions because i am new to android coding.

 now i am really in a  need of some forum/ good group which is interactive
 and let me post my queries to get answers from geeks like this group.

 please suggest me some of them.

 --
 Regards
 Kumar Raja
 M.Tech(SIT)
 IIT Kharagpur,
 10it60...@iitkgp.ac.in





-- 
Regards
Kumar Raja
M.Tech(SIT)
IIT Kharagpur,
10it60...@iitkgp.ac.in

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Forums on android

2012-02-13 Thread Amol Sharma
android-develop...@googlegroups.com
--


Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
 http://gplus.to/amolsharma99
http://twitter.com/amolsharma99http://in.linkedin.com/pub/amol-sharma/21/79b/507http://www.simplyamol.blogspot.com/






On Tue, Feb 14, 2012 at 12:34 PM, kumar raja rajkumar.cs...@gmail.comwrote:

 Reply me soon

 On 14 February 2012 12:32, kumar raja rajkumar.cs...@gmail.com wrote:

 This is an off topic , but because still i am in very need of it i am
 asking.

 i have joined in stackoverflow forum, but now it is not letting me to ask
 questions as i have posted some inferior quality questions in it.
 But i have asked a lot of questions because i am new to android coding.

 now i am really in a  need of some forum/ good group which is interactive
 and let me post my queries to get answers from geeks like this group.

 please suggest me some of them.

 --
 Regards
 Kumar Raja
 M.Tech(SIT)
 IIT Kharagpur,
 10it60...@iitkgp.ac.in





 --
 Regards
 Kumar Raja
 M.Tech(SIT)
 IIT Kharagpur,
 10it60...@iitkgp.ac.in


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.