Skip to content

Commit 69369f5

Browse files
committed
just for test
1 parent 0fc116a commit 69369f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

LuoSonglei/Subsets.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ void combination(int* nums, int numsSize, int** columnSizes, int* returnSize, in
1212
{
1313
if(index == numsSize)
1414
{
15-
columnSizes[returnSize] = setIndex;
15+
*columnSizes[*returnSize] = setIndex;
1616
return;
1717
}
1818
for(int i = 0; i < *returnSize; i++)
1919
{
2020
if(i < *returnSize/2)
2121
{
2222
combination(nums, numsSize, columnSizes, *returnSize/2, allSets, index + 1, setIndex + 1);
23-
allSet[i] = nums[index];
23+
allSets[i] = nums[index];
2424
}
2525
else
2626
{
@@ -39,9 +39,9 @@ int **subsets(int* nums, int numsSize, int** columnSizes, int* returnSize)
3939
}
4040
columnSizes = (int*)malloc(sizeof(int*) * total);
4141
*returnSize = total;
42-
int allSets[][] = (int*)malloc(sizeof(int*) * total);
42+
int **allSets = (int*)malloc(sizeof(int*) * total);
4343
for(int i = 0; i < total; i++)
4444
allSets[i] = (int*)malloc(sizeof(int) * numsSize);
45-
combination(nums, numsSize, columnSizes, returnSize, allSet, 0, 0);
45+
combination(nums, numsSize, columnSizes, returnSize, allSets, 0, 0);
4646
return allSets;
4747
}

0 commit comments

Comments
 (0)