## Draw Recursion Stack

[Question]: Prepare recursion stack for multilevel recursion.

recursion code examples in swift language.

[Question]: Prepare recursion stack for multilevel recursion.

[Question] : Find subset sum in given ArrayExample: Input: N = 6 arr[] = {3, 34, 4, 12, 5, 2} sum = 9 Output: 1 Explanation: Here there exists a subset with sum = 9, 4+3+2 = 9.

[Question]: In a distinct array a target integer target, return a list of all unique combinations of candidateInput: candidates = [2,3,6,7], target = 7 Output: [[2,2,3],[7]]

[Question]: In an array count all possible sequence whose sum is K. example:- [4,8,4] Target Sum = 8 So Output will be 2 because sequences are: [4,4] [8]

[Question] : Print any one sequence whose some is equal to KFor example:- [4,8,4] Target Sum = 8 So Output will be [4,4]

[Question] : In a given array find all possible sequence whose sum is certain number: For example:- [4,8,4] Target Sum = 8 So Output will be [4,4] [8]

Here we will discuss two level recursion in swift. If there is statement before the recursive function it will print in sequence & vice versa. Here is example code with print statement –

[Question]: We haveGiven an array, generate all the possible subarrays of the given array using recursion for example :

[Question] : Reverse array using recursion Example: [1,2,3] = [3,2,1]. Approach #1 using two variables : – // Approach#2: Using single pointer/variable so we written base case which blocks on n/2, we are just increasing the element by +1 on every recursion till half of the array.

So here we have used recursion The names which is before function will print FIFO & vice versa