Re: [algogeeks] puzzle

2012-02-28 Thread Vaibhav Mittal
Ntn else is provided..??
On Feb 28, 2012 12:51 PM, Gaurav Popli abeygau...@gmail.com wrote:

 Given a sequance of natural numbers.

 Find N'th term of this sequence.

 a1=2, a2=4, a3=11, a4=36, a5=147, a6=778 ... ... ... ... aN.


 this is a coding quesn and O(n) soln is also welcome...

 --
 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] Re: Find all possible combination of integers for a given sum

2011-10-26 Thread Vaibhav Mittal
+1 Prem
@ligerdave : I knew about the recursion method..but can u throw some light
on the pointer based method..(with a small example maybe)..
Specifically I wanted to know the implementation part and the running time
of the algorithm.

On Wed, Oct 26, 2011 at 8:33 PM, ligerdave david.c...@gmail.com wrote:

 @meng You already have the pattern figured out. each time subtract 1
 from the lowest digit and add to higher digit(only once), until the
 lowest digit equals to closest higher digit. the selection of which
 number to start could be figured out with given parameters sum and
 combination

 @Prem, no recursion needed here. it make it more complex than
 necessary. one loop with a pointer should be able to resolve this

 On Oct 24, 6:28 pm, Meng Yan mengyan.fu...@gmail.com wrote:
  Hi, my question is
 
  given sum=N and combination constraint=M (the number of elements), how to
  find all possible combinations of integers?
 
  For example, given sum=6, combination=3; how to get the result as
 following:
  1+1+4;
  1+2+3;
  2+2+2;
 
  We don't care about order of the elements, which means 1+1+4 and 1+4+1
 are
  considered as same combination.
 
  Thanks a lot!
 
  Meng

 --
 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] Re: MS

2011-08-02 Thread Vaibhav Mittal
dynamic programming with binary search should do it..

Regards
VM
NSIT, COE, 3rd yr

On Tue, Aug 2, 2011 at 6:19 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote:

 @sunny:yes all the squares should be of same size


 On Tue, Aug 2, 2011 at 5:03 PM, Poised~ dip10c...@gmail.com wrote:

 @ narain-
 i didn't see that coming. thanks for the heads up.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/oSuB8bJuqDcJ.

 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.




 --
 Regards,
 Kamakshi
 kamakshi...@gmail.com

 --
 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.