private NhoNhanhCollection TaoDsONhoNhanh(List<TuVung> DSNgauNhien) { NhoNhanhCollection NhoNhanhColl = new NhoNhanhCollection(); for (int i = 0; i < 10; i++) { NhoNhanhBO nnBO = new NhoNhanhBO(); nnBO.STTEng = i; nnBO.NoiDungEng = DSNgauNhien[i].Tu; NhoNhanhColl.Add(nnBO); NhoNhanhBO nnBO1 = new NhoNhanhBO(); nnBO1.STTEng = i; nnBO1.NoiDungEng = DSNgauNhien[i].NghiaTu; NhoNhanhColl.Add(nnBO1); } return NhoNhanhColl; }
private NhoNhanhCollection HoanViONhoNhanh(NhoNhanhCollection nhonhanhColl) { NhoNhanhCollection nhonhanhCollCopy = nhonhanhColl; NhoNhanhCollection NhoNhanhColl = new NhoNhanhCollection(); int []kt= new int[20]; for (int k = 0; k < 20; k++) kt[k] = -1; int i = 0; int j = 20; while (i < 20) { int rd = random(j); NhoNhanhColl.Add(nhonhanhCollCopy.Index(rd)); nhonhanhCollCopy.Remove(rd); i++; j--; } return NhoNhanhColl; }