Deprecated: $wgMWOAuthSharedUserIDs=false is deprecated, set $wgMWOAuthSharedUserIDs=true, $wgMWOAuthSharedUserSource='local' instead [Called from MediaWiki\HookContainer\HookContainer::run in /var/www/html/w/includes/HookContainer/HookContainer.php at line 135] in /var/www/html/w/includes/Debug/MWDebug.php on line 372
McLaren's masterpiece - MaRDI portal

McLaren's masterpiece (Q1106015)

From MaRDI portal





scientific article; zbMATH DE number 4060704
Language Label Description Also known as
English
McLaren's masterpiece
scientific article; zbMATH DE number 4060704

    Statements

    McLaren's masterpiece (English)
    0 references
    0 references
    1987
    0 references
    The problem addressed in this paper can be described as follows: Given an array \(b[0..n-1]\) and a permutation of \((0,1,...,n-1)\) given by an array \(H[0..n-1],\) rearrange b according to this permutation, that is, execute the multiple assignment \[ b[0],\;b[1],\;...,\;b[n-1] := b[H[0]],\;b[H[1]],\;...,\;b[H[n-1]]. \] The paper gives a new and formal description of an in-situ linear time algorithm due to Donald McLaren. For this algorithm H is encoded as a ``linked list'' represented by a variable p and an array \(c[0..n-1]\) such that \[ \begin{aligned} H[0] &= p, \\ H[1] &= c[p], \\ H[2] &= c[c[p]], \text{ etc.} \end{aligned} \] The description of the algorithm given in the paper first explores changes of H that can be performed easily by manipulating its representation using p and c.
    0 references
    McLaren's algorithm
    0 references
    multiple assignment
    0 references
    permutation
    0 references
    formal description
    0 references
    in-situ linear time algorithm
    0 references

    Identifiers

    0 references
    0 references
    0 references
    0 references
    0 references
    0 references