This is a good place to use recursion. One thing you have to know is whether order matters. E.g., are 2 + 1 and 1 + 2 the same or different ways to represent 3 as a sum of positive integers. This choice will affect the way you write the recursive function.
Dave On Mar 11, 9:33 am, saurabh agrawal <saurabh...@gmail.com> wrote: > Given an integer n , you have to print all the ways in which n can be > represented as sum of positive integers -- 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.