aboutsummaryrefslogtreecommitdiff
path: root/Computer_Science/leetcode/46-permutations.c~
blob: 5a7f346587c546fc518565b92feb41bedfea2615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Return an array of arrays of size *returnSize.
 * Note: The returned array must be malloced, assume caller calls free().
 */
int** permute(int* nums, int numsSize, int* returnSize) {
    for(int i = 0; i < numsSize; i++) {
		backtracking(nums, i + 1, numsSize, returnSize);
	}
}

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, i + 1, numsSize, returnSize);
}