我有一組80名學生,我需要將它們分成20組4.我有他們以前的考試成績來自先決條件模塊,我想確保排序的組成員分數的平均值儘可能接近先前考試分數的總體平均值。 對不起,如果不是特別清楚。 這裏的問題的快照: Student Score
AA 50
AB 45
AC 80
AD 70
AE 45
AF 55
AG 65
AH 90
所以分數的平均這裏爲
我對能夠按照遞增和的順序生成或排序某些集合的子集的算法感興趣。我已經回顧了一些類似的問題,但他們只討論以線性順序生成子集,如Algorithm to generate k element subsets in order of their sum和Algorithm wanted: Enumerate all subsets of a set in order of increasing sums
我有困難,瞭解如何開發遞推關係。我給出的代碼是 int result = bizarre(n, n);
public static int bizarre (int first, int second)
{
if (second <= 1)
{
int temp = 0;
for (int i = 0; i < first; i++)
tem
是否該算法工作在O(N log(N))爲3SUM一個解決方案,該問題是由維基百科 在計算複雜性理論定義的,3SUM問題詢問一組給定ň實數包含三個元素總和爲零。 //Given an array of integers called list
//return true if 3 integers in list sum to 0, false otherwise
//quicksort th
我有這樣一個類: public enum ReturnCode{
Code1(
"Code1",
"Return this code when there is an erreur"
),
Code2(
"Code2",
"Return this code when everything ok"
);
ReturnCode(fin
public int Loop(int[] array1) {
int result = 0;
for (int i = 0; i < array1.length; i++) {
for (int j = 0; j < array1.length; j++) {
for (int k = 1; k < array1.length; k = k