-
Category : Windows Develop
Tags :
- Update : 2008-10-13
- Size : 63.87kb
- Downloaded :0次
- Author :林***
- About :
林总
- PS : If download it fails, try it again. Download again for free!
Introduction - If you have any usage issues, please Google them yourself
The algorithm realizes the dictionary order problem of 2-9 permutation
Description of laquo:
N elements {1,2, 61516, n} have n! A different arrangement. The n! The list is arranged in a dictionary and numbered 0, 1... ,
N! 1. The number of each rank is its dictionary order value. For example, when n= 3, the order values of the six different sequences are as follows:
Dictionary order is 0, 1, 2, 3, 4, 5
Permutation: 123 132 213 231 312 321
« programming tasks:
Given n and n elements {1,2, 61516, n}, compute the lexicon of this arrangement, and by word
The next permutation of the ordinal sequence.
« data input:
Input data is provided by input.txt. The first line of the file is the number of elements n. The next one is going to be n elements
{1,2, 61516, n}.
« result output:
At the end of the program run, the sorted dictionary order values are calculated and the next permutation in the lexicon is output to the file
The output. TXT. The first line of the file is the dictionary sequence, and line 2 is the next sequence in the lexicon.
An example of the input file example output file
Input. TXT output. TXT
8
2, 6, 4, 5, 8, 1, 7, 3
8227
2, 6, 4, 5, 8, 3, 1, 7
Packet file list
(Preview for download)
Packet : 55593406permrank.rar filelist
1\permrank.cpp
1\permrank.ppt
1\permrank.pdf
1
Related instructions
- We are an exchange download platform that only provides communication channels. The downloaded content comes from the internet. Except for download issues, please Google on your own.
- The downloaded content is provided for members to upload. If it unintentionally infringes on your copyright, please contact us.
- Please use Winrar for decompression tools
- If download fail, Try it againg or Feedback to us.
- If downloaded content did not match the introduction, Feedback to us,Confirm and will be refund.
- Before downloading, you can inquire through the uploaded person information