📄 permutation.html
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN">
<HTML lang="en-US">
<HEAD>
<TITLE>permutation</TITLE>
<META name="description"
content="Definition of permutation,
possibly with links to more information and implementations.">
<META name="keywords" content="permutation">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>permutation</H1>
<P>
(algorithm)
<P>
<strong>Definition:</strong>
A rearrangement of elements, where none are lost, added, or changed. A good algorithm to randomly permute N elements is to exchange each element e<sub>i</sub> with a random element from i to N. Another algorithm is to tag each element with a random number, sort the array by the tags, then remove the tags.
<P><strong>See also</strong>
<a href="randomnumgen.html" tppabs="http://hissa.nist.gov/dads/HTML/randomnumgen.html"><em>random number generator</em></a>, <a href="sort.html" tppabs="http://hissa.nist.gov/dads/HTML/sort.html"><em>sort</em></a>.
<P><em>Note:
A sort is a permutation where the items are arranged in some order. The first algorithm can be viewed as a reverse <a href="selectionsrt.html" tppabs="http://hissa.nist.gov/dads/HTML/selectionsrt.html"><em>selection sort</em></a>, and is described in detail in <A HREF="terms.html#DEK" tppabs="http://hissa.nist.gov/dads/terms.html#DEK">Knuth</A>, vol. 2. It consumes <a href="bigOnotation.html" tppabs="http://hissa.nist.gov/dads/HTML/bigOnotation.html"><em>O(N log N)</em></a> bits and runs in <a href="linear.html" tppabs="http://hissa.nist.gov/dads/HTML/linear.html"><em>linear</em></a> time. The second algorithm consumes <a href="theta.html" tppabs="http://hissa.nist.gov/dads/HTML/theta.html"><em> <img src="Theta-1.gif" tppabs="http://hissa.nist.gov/dads/HTML/Images/Theta.gif" border=0 height=10 width=8 alt="Capital Theta">(N log N)</em></a> bits and runs in <a href="bigOnotation.html" tppabs="http://hissa.nist.gov/dads/HTML/bigOnotation.html"><em>O(N log N)</em></a> time.</em>
<P>Author: <a href="terms.html#authorPEB" tppabs="http://hissa.nist.gov/dads/terms.html#authorPEB">PEB</a>
<H2>Implementation</H2>
<A HREF="javascript:if(confirm('http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.cs.sunysb.edu/%7Ealgorith/files/generating-permutations.shtml \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.cs.sunysb.edu/%7Ealgorith/files/generating-permutations.shtml'" tppabs="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://www.cs.sunysb.edu/%7Ealgorith/files/generating-permutations.shtml">(Pascal, Fortran, Mathematica, and C)</A>
<hr>
Go to the
<A HREF="terms.html" tppabs="http://hissa.nist.gov/dads/terms.html">Algorithms, Data Structures, and Problems</A>
home page.
<hr>
If you have suggestions, corrections, or comments, please get in touch
with
<a href="javascript:if(confirm('http://hissa.nist.gov/~black/black.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://hissa.nist.gov/~black/black.html'" tppabs="http://hissa.nist.gov/~black/black.html">Paul E. Black</a>
(<a href="mailto:paul.black@nist.gov">paul.black@nist.gov</a>).
<p>
Entry modified Mon Nov 29 13:17:58 1999.<BR>
HTML page formatted Wed Dec 22 09:36:08 1999.
<P>
This page's URL is
<A href="permutation.html" tppabs="http://hissa.nist.gov/dads/HTML/permutation.html">http://hissa.nist.gov/dads/HTML/permutation.html</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -