sir please tell me how to solve tricky permutations problem.
Not able to solve tricky permutations problem
sir i am finding it difficult to solve the problems of backtracking portion.So please tell me how can i solve them
If you are using recursive swapping approach for finding permutation,
Then I you should check if you should perform swapping or not.
Approach:
Permuatation(arr, indx, n){
For i= indx to n{
//Check if you should swap index with I or not
If arr[i] is not present between index indx and i-1, then do swapping
else if it is already present, then swapping will lead to duplicate permutation., Thus, don’t perform swapping.
}
}
Hope, this would help.
Give a like, if you are satisfied.
hi rishabh
start with the basic problems first. try spending time on that.
with time you will be able to solve the questions don’t worry
incase of any help you can ping us
Ma’am can you please tell me from where I can practice basic questions
start with problems of rat maze, nqueen
you can try practise questions on hackerblocks
or search online for variety of questions