Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
QuestionEvery possible group of items in an array/set/... [SOLVED] Pin
Bart Van Eyndhoven28-Apr-10 21:59
Bart Van Eyndhoven28-Apr-10 21:59 
GeneralRe: Every possible group of items in an array/set/... Pin
harold aptroot28-Apr-10 22:09
harold aptroot28-Apr-10 22:09 
GeneralRe: Every possible group of items in an array/set/... Pin
Bart Van Eyndhoven28-Apr-10 22:59
Bart Van Eyndhoven28-Apr-10 22:59 
GeneralRe: Every possible group of items in an array/set/... Pin
Alan Balkany29-Apr-10 4:00
Alan Balkany29-Apr-10 4:00 
AnswerRe: Every possible group of items in an array/set/... Pin
PIEBALDconsult29-Apr-10 3:45
mvePIEBALDconsult29-Apr-10 3:45 
GeneralRe: Every possible group of items in an array/set/... Pin
Bart Van Eyndhoven29-Apr-10 22:21
Bart Van Eyndhoven29-Apr-10 22:21 
GeneralRe: Every possible group of items in an array/set/... Pin
harold aptroot29-Apr-10 6:01
harold aptroot29-Apr-10 6:01 
AnswerRe: Every possible group of items in an array/set/... Pin
Kythen29-Apr-10 6:44
Kythen29-Apr-10 6:44 
If you can find a copy, Volume 4 Fasicle 3 of Donald Knuth's The Art Of Computer Programming is pretty much the definitive work on combination generator algorithms.

Wikipedia's article[^] on the topic has a reference to Gosper's hack down at the bottom which may be of some use to you. It's a nifty hack to get the next highest number with the same number of 1 bits in the binary representation. Each bit of the output should correspond to an entry in your generated array. Run this for each bit count from 1 to the number of items in your array and you should have your combinations.

Of course, if you have more than a few items in your array, you should probably find some other way to check whatever it is you're checking. Generating combinations is order O(N choose t), so the running time is going to get big pretty quickly the more items you have in your array.
QuestionExcel Interop Pin
nuonxxx28-Apr-10 21:27
nuonxxx28-Apr-10 21:27 
Questiondelegates and events in c# Pin
jitendra sandu28-Apr-10 21:09
jitendra sandu28-Apr-10 21:09 
AnswerRe: delegates and events in c# Pin
Rajesh Anuhya28-Apr-10 21:15
professionalRajesh Anuhya28-Apr-10 21:15 
AnswerRe: delegates and events in c# Pin
nagendrathecoder28-Apr-10 21:18
nagendrathecoder28-Apr-10 21:18 
AnswerRe: delegates and events in c# Pin
Md. Marufuzzaman28-Apr-10 21:27
professionalMd. Marufuzzaman28-Apr-10 21:27 
Questionwhere is the site that i can download msdn for visual 2005? Pin
buffering8328-Apr-10 19:39
buffering8328-Apr-10 19:39 
AnswerRepost Pin
DaveyM6928-Apr-10 20:30
professionalDaveyM6928-Apr-10 20:30 
AnswerRe: where is the site that i can download msdn for visual 2005? Pin
Rajesh Anuhya28-Apr-10 21:12
professionalRajesh Anuhya28-Apr-10 21:12 
QuestionHow to Remove Sharing Permission of a Folder through c# Pin
himuskanhere28-Apr-10 18:37
himuskanhere28-Apr-10 18:37 
AnswerRe: How to Remove Sharing Permission of a Folder through c# Pin
Md. Marufuzzaman28-Apr-10 21:37
professionalMd. Marufuzzaman28-Apr-10 21:37 
QuestionPass ctrl + c to a process (console application) from another app/service Pin
Spunky Coder28-Apr-10 15:21
Spunky Coder28-Apr-10 15:21 
AnswerRe: Pass ctrl + c to a process (console application) from another app/service Pin
PIEBALDconsult28-Apr-10 16:11
mvePIEBALDconsult28-Apr-10 16:11 
AnswerRe: Pass ctrl + c to a process (console application) from another app/service Pin
#realJSOP29-Apr-10 1:49
mve#realJSOP29-Apr-10 1:49 
QuestionCombinations Pin
James Towers28-Apr-10 10:59
James Towers28-Apr-10 10:59 
AnswerRe: Combinations Pin
Luc Pattyn28-Apr-10 11:54
sitebuilderLuc Pattyn28-Apr-10 11:54 
AnswerRe: Combinations Pin
PIEBALDconsult28-Apr-10 14:07
mvePIEBALDconsult28-Apr-10 14:07 
GeneralRe: Combinations Pin
James Towers28-Apr-10 14:29
James Towers28-Apr-10 14:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.