Posts Tagged ‘permutation

一直以来我对数的排列这类算法问题都感到很头痛,曾经囫囵吞枣看过一些算法,可是浅尝辄止,没有实际操作所以每次都忘记。上周三算法分析与设计课的内容是递归,老师正好提到了排列数这一问题,于是就有机会稍微进行一些研究。 一个排列(permutation)就是对一组对象或者数值按照某种特定的方式进行排列组织(ar-rangement),为了方便起见我们以一个数集{1, 2, 3}为例,它的全排列共有3!=6种,即{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1},上述列举排列的顺序又称为按字典序列举排列,具体将在下文进行叙述。 一、字典序 在Wikipedia中,字典序的解释是这样的: In mathematics, the lexicographic or lexicographical order, (also known as dictionary order, alphabetic order  or lexicographic(al) product), is a natural order  structure of the Cartesian product of two ordered sets. 如果你拥有一个字典,那么里面所有的字符串都是按照字典序来进行排序的,假设有两个字符串: a1, [...]


About this blog

I'm now a graduate student of Computer Applied Technology in Tongji University. I like Computer Graphics, Web 2.0, Magic, Music and am partially a geek. This blog is about C++, algorithm, cg, comments and other things I may get in touch with in the near future. Hope everyone enjoy this little site. Contact me: 4everlove.xu AT gmail.com

Photostream

日历

2012 年五月
« 二    
 12345
6789101112
13141516171819
20212223242526
2728293031  

TwitterWidget

6 分钟 ago
@pipitu 试试威胁投诉他们非法自建?
view tweet
16 分钟 ago
@pipitu 对这种房东要强硬点~自建房是以前我住的那种自己用墙做出的隔板房吗?
view tweet
21 分钟 ago
新东方的留学讲座大部分都是家长来听…看来家长更喜欢中介~
view tweet
1 小时 ago
@pipitu @r475 @Hanliinter 为了你将来的GRE,记住glisten这个单词吧=-=
view tweet
1 小时 ago
@Hanliinter @r475 有一班直达的公交……
view tweet
2 小时 ago
@r475 @Hanliinter 考虑到日常和妹子的现充时间,可以省下很多成本(ry 其实我那边也不算中山公园了,好像在中介上面已经归到娄山关路或者古北去了……
view tweet
3 小时 ago
@Hanliinter 不过像我这样工作在徐汇,想要住在中山公园的,估计现在大部分公租房的条件就满足不了
view tweet
3 小时 ago
@Hanliinter 国内的公租房规模还太小啊~
view tweet
5 小时 ago
@ispinel 嗯……或者刷一刷等级的时候,现在看来只要保持在中烧以上应该就安全一点了@@
view tweet
6 小时 ago
@ispinel 赞!虽然似乎没有达到它标称的速度,不过比毛细宽带上传管要好太多了~
view tweet
Follow me!

FeedBurner RSS