### Improved Permutations with the BigInteger Data Type: Listing 2

The Permutation Successor method.

```public Permutation Successor()
{
if ((left == 0) && data[left] > data[left+1))
return null;
Permutation result = new Permutation(this.n);

for (int idx = 0; idx < result.n; ++idx)  // curr data to result
result.data[idx] = this.data[idx];

int left, right;

left = n - 2;  // Find left value
while ((result.data[left] > result.data[left + 1]) && (left >= 1))
--left;

right = n - 1;  // find right; first value > left
while (result.data[left] > result.data[right])
--right;

int tmp = result.data[left];  // swap [left] and [right]
result.data[left] = result.data[right];
result.data[right] = tmp;

int i = left + 1;  // order the tail
int j = n - 1;
while (i < j)
{
tmp = result.data[i];
result.data[i++] = result.data[j];
result.data[j--] = tmp;
}

return result;
}
```

Dr. James McCaffrey works for Microsoft Research in Redmond, Wash. He has worked on several Microsoft products including Azure and Bing. James can be reached at [email protected].

• ### .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

• ### Data Anomaly Detection Using a Neural Autoencoder with C#

Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

• ### What's New for Python, Java in Visual Studio Code

Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

• ### Microsoft Build 2024 Sessions Listed: Copilots, Copilots & More Copilots

Microsoft today announced the session catalog for its Build developer conference next month in Seattle, with AI unsurprisingly dominating the event.

• ### Microsoft Unifying Copilot Tools in Visual Studio 2022

Next month developers will no longer need to install two different extensions to use GitHub Copilot and Copilot Chat in Visual Studio 2022, as Microsoft is combining the two tools into a single package.