组合算法 [英] combinations algorithm

查看:187
本文介绍了组合算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想进行简单的排序算法。

给定了输入ABCDE,我想下面的输出。你能告诉我的算法是什么?

 改编[0] =A
改编[1] =AB
ARR [2] =AC
ARR [3] =广告
改编[4] =AE
改编[5] =ABC
改编[6] =ABD
改编[7] =阿部
...
ARR [N] =ABCDE改编[N + 1] =b的
改编[N + 2] =BC
ARR [N + 3] =BD
ARR [N + 4] =是
ARR [N + 5] =BCD
ARR [N + 5] =公元前
ARR [N + 5] =BDE
...
ARR [N + M] =BCDE
...
...


解决方案

从数组发电集的算法是你在找什么。您可以尝试谷歌或其他搜索引擎来找到最适合您需要的算法。

I want to make simple sorting algorithm.

given the input "abcde", I would like the output below. could you tell me the algorithm for that?

arr[0] = "a"
arr[1] = "ab"
arr[2] = "ac"
arr[3] = "ad"
arr[4] = "ae"
arr[5] = "abc"
arr[6] = "abd"
arr[7] = "abe"
...
arr[n] = "abcde"

arr[n+1] = "b"
arr[n+2] = "bc"
arr[n+3] = "bd"
arr[n+4] = "be"
arr[n+5] = "bcd"
arr[n+5] = "bce"
arr[n+5] = "bde"
...
arr[n+m] = "bcde"
...
...

解决方案

An algorithm for "generating Power Set" from an array is what you are looking for. You can try Google or some other search engine to find the algorithm that best fits your needs.

这篇关于组合算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆