### set menthod=manual

#### 折叠不会被写入到文件里，如果使用catless查看代码，代码将以无任何折叠的方式显示。

A folder is just a tag which tells vim to display something as a folder. So it is also possible to write a file with folders. To mark the start of a folder just use for example in a comment of a source file) and to mark the end of the folder.

### function

Sort elements in range Sorts the elements in the range first,last) into ascending order.

The elements are compared using operator< for the first version, and comp for the second.

Elements that would compare equal to each other are not guaranteed to keep their original relative order.

### Parameters

first, last Random-Access iterators to the initial and final positions of the sequence to be sorted. The range used is first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by last. comp Comparison function object that, taking two values of the same type than those contained in the range, returns true if the first argument goes before the second argument in the specific strict weak ordering it defines, and false otherwise.

none

### Output:

myvector contains: 12 26 32 33 45 53 71 80

### Complexity

Approximately NlogN comparisons on average (where N is last-first). In the worst case, up to N2, depending on specific sorting algorithm used by library implementation.

## next_permutation

### Transform range to next permutation

Rearranges the elements in the range first, last) into the lexicographically next greater permutation of elements. The comparisons of individual elements are performed using either operator< for the first version, or comp for the second.

A permutation is each one of the N! possible arrangements the elements can take (where N is the number of elements in the range). Different permutations can be ordered according on how they compare lexicographicaly to each other; The first such-sorted possible permutation (the one that would compare lexicographically smaller to all other permutations) is the one which has all its elements sorted in ascending order, and the largest has all its elements sorted in descending order.

If the function can determine the next higher permutation, it rearranges the elements as such and returns true. If that was not possible (because it is already at the largest), it rearranges the elements according to the first permutation (sorted in ascending order) and returns false.

### Parameters

first, last Bidirectional iterators to the initial and final positions of the sequence. The range used is first,last), which contains all the elements between first and last, including the element pointed by first but not the element pointed by last. comp Comparison function object that, taking two values of the same type than those contained in the range, returns true if the first argument is to be considered less than the second argument.

### Return value

true if the function could rearrange the object as a lexicographicaly greater permutation. Otherwise, the function returns false to indicate that the arrangement is not greater than the previous, but the lowest possible (sorted in ascending order).

### Output:

The 3! possible permutations with 3 elements:

1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1

### 上升全排列

int myints[] = {1,2,3}; 输出为：
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1

int myints[] = {3,2,1}; 输出为：
3 2 1

int myints[] = {2,3,1}; 输出为：
2 3 1
3 1 2
3 2 1

### Complexity

At most, performs one half as many swaps as the number of elements in the range.

### Graphviz:

REXML could not parse this XML/HTML:
<blockquote><p>AT&T Labs Tools for viewing and interacting with graph diagrams.<br />Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. Automatic graph drawing has many important applications in software engineering, database and web design, networking, and in visual interfaces for many other domains. Graphviz is open source graph visualization software. It has several main graph layout programs.</p></blockquote>

DOT

DOT is a plain text graph description language. It is a simple way of describing graphs that both humans and computer programs can use. DOT graphs are typically files that end with the .gv (or .dot) extension. The .gv extension is preferred, as the .dot file extension is used by Microsoft Office 2003.

* 有向 * 无向