且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Java中生成所有排列

更新时间:2023-01-11 22:32:37

使用递归函数而不是循环。每次调用方法时,都应该在数组的较小部分上,并在length = 0时停止。这个链接应该可以帮助您设计功能。

Use a recursive function, instead of loops. Each time you call the method should be on a smaller portion of the array and stop when length = 0. This link should help you design your function.