aboutsummaryrefslogtreecommitdiff
path: root/Computer_Science/leetcode/46-permutations.c
blob: 1249253fdc1a74b5e9c4238f9d40f90495ddc19e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * Return an array of arrays of size *returnSize.
 * Note: The returned array must be malloced, assume caller calls free().
 */
void backtracking(int* nums, int start, int numsSize, int* returnSize)
{
	if(start == numsSize) return;
	else if(start == numsSize -1) {
		//add all to result
	} else
		backtracking(nums, start + 1, numsSize, returnSize);
}

int** permute(int* nums, int numsSize, int* returnSize) {
    for(int i = 0; i < numsSize; i++) {
		backtracking(nums, i, numsSize, returnSize);
	}
}