| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /*
- * Please fill the functions in this file.
- * You can add additional functions.
- *
- * Hint:
- * You can write additonal functions.
- *
- * You may create additional arrays if needed. The maximum size
- * needed is specified by MAXLENGTH in pa01.h.
- */
- #include "pa01.h"
- #include <stdio.h>
- #include <stdlib.h>
- /*
- * =================================================================
- * This function prints all partitions of a positive integer value
- * See the file "expected/expected_unsorted" for the output specification
- */
- void partitionAll(int value)
- {
- printf("partitionAll %d\n", value);
- }
- /*
- * =================================================================
- * This function prints the partitions that use increasing values.
- *
- * For example, if value is 5
- * 2 + 3 and
- * 1 + 4 are valid partitions
- *
- * 5 is a valid partition
- *
- * 1 + 1 + 3 and
- * 2 + 1 + 2 and
- * 3 + 2 are invalid partitions.
- *
- * The program should generate only valid partitions. Do not
- * generates invalid partitions and checks validity before printing.
- *
- */
- void partitionIncreasing(int value)
- {
- printf("partitionIncreasing %d\n", value);
- }
- /*
- * =================================================================
- * This function prints the partitions that use unique values.
- *
- * For example, if value is 5
- * 2 + 3 and
- * 3 + 2 and
- * 1 + 4 are valid partitions
- *
- * 5 is a valid partition
- *
- * 1 + 1 + 3 and
- * 2 + 1 + 2 are invalid partitions.
- *
- * The program should generate only valid partitions. Do not
- * generates invalid partitions and checks validity before printing.
- *
- */
- void partitionUnique(int value)
- {
- printf("partitionUnique %d\n", value);
- }
- /*
- * =================================================================
- */
- void permute(char * charset, int len)
- {
- printf("permute %d\n", len);
- }
|