Consider I have an array with 3 elements.

```
4 6 7
```

I want to know that is there any algorithm to find all possible rearranging for that array like,

```
4 6 7
4 7 6
6 4 7
6 7 4
7 4 6
7 6 4
```

Is there any algorithm for that or any ways for solving it.