
Recent Posts
Archives
calendar
Categories
Meta
Tag Cloud
Advertisements
package algorithm.weixin; public class Perm { public static void swap(int[] v, int i, int j) { int t; t = v[i]; v[i] = v[j]; v[j] = t; } public static void perm(int[] v, int n, int i) … Continue reading
From Evernote: Analysis of Algorithms: Lecture 24 Clipped from: http://www.cs.utexas.edu/users/djimenez/utsa/cs3343/lecture25.html Algorithms for Permutations and Combinations Here are some algorithms I have found useful in surprisingly many instances: Generating Permutations of a Set of Elements We know that there are n! … Continue reading
http://computerserviceofsouthflorida.com/algorithms.html Combinations Algorithm Introduction=========This is a general algorithm for generating the combinations when x items arechosen from y items. The number of combinations is given by the formula:y!/((yx)!x!), where ! denotes factorial. This number is easily calculated.The problem … Continue reading