Re: string combination script?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




John Coleman wrote:
(snip)
For reasons unrelated to
this thread I had recently wanted an algorithm that would iterate
through all ways to partition a set of around 30 items into 3 disjoint
subsets. My initial algorithm wasn't very efficient, so when I
recognized the problem as being one of multiset permutations ...

This is a slight mistatement. I was looking at iterating over such
things when the size of the 3 subsets was fixed. Say you want to
paritition 30 elements into 3 sets of size 10. One way to code such a
thing is by a string like "aabaccbaa...ab" where you have 10 a's, 10
b's and 10 c's. Then each distinguishable permutation corresponds to a
unique partition and vice versa.

.



Relevant Pages

  • Re: Fastest way to sort
    ... If we assume there is no duplicated values, and if we assume we are at the stage of the algorithm where the partitions are made, consider those partitions: A and C such that element a is in A are such that ab (b = the pivot). ... No element a in A would further interact with any element c in C, and vice-versa, by virtue of what a partition is. ... So, since the "recursive sorts" stage does not involve the actual pivot, a, and since the "2-way partition" stage seems to involve at most one comparison between the pivot and any other element a, I don't see why the 'basic' quick sort algorithm could involve two given elements compared together more than once, ever. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: find the largest 1000 values
    ... "Anthony Wieser" wrote: ... the algorithm could be Oif you were startlingly unlucky ... Because most partition algorithms choose the middle element to partition ... algorithm is linear. ...
    (microsoft.public.vc.language)
  • Re: find the largest 1000 values
    ... "Anthony Wieser" wrote: ... the algorithm could be Oif you were startlingly unlucky ... Because most partition algorithms choose the middle element to partition ... algorithm is linear. ...
    (microsoft.public.vc.language)
  • Re: "Central term" (median) for a very very large set of numbers
    ... after every partitioning pass, only one partition needs to ... quicksort-based algorithm for this, which is parallelizable and so might run ... a single pass will usually find the median. ... which can fail: fill memory with a random sample from ...
    (sci.math)
  • Re: "Central term" (median) for a very very large set of numbers
    ... after every partitioning pass, only one partition needs to ... quicksort-based algorithm for this, which is parallelizable and so might run ... a single pass will usually find the median. ... closest to that sample median from below, and a count of how many elements ...
    (sci.math)