Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
A partition of a positive integer n is a sequence of positive integers that sum to n. Write an algorithm in psedocode and then implement the algorithm (in C) to print all non-increasing partitions of n.

eg. If n=4
4
3 1
2 2
2 1 1
1 1 1 1
Posted
Updated 7-Sep-10 23:04pm
v3
Comments
Richard MacCutchan 8-Sep-10 9:48am    
OK, I have done that and it worked. Do I get a good prize?
HimanshuJoshi 8-Sep-10 10:38am    
Reason for my vote of 1
Do your own homework
Sandeep Mewara 8-Sep-10 12:59pm    
Reason for my vote of 1
No effort

1 solution

Hi,

This is obviously an assignment and no one here will do your homework for you. Have a go and come back with a question when you get stuck.

:thumbsup:
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900