[理工] DS 101台大
1. Assume that the elements are pairwise distinct. Answer the following questions on sorting algorithms.
(2)A single comparison between two elements can distinguish up to 2 permutations. How many permutations can be distinguished using k comparisons?
我的答案:(k+1)!
不知道這題的意思是什麼,我的假設是在k+1個數之下做 k comparisons,如果有3個數做2 comparisons 應該可以有 3!個組合,因為每種組合似乎都可以用最多兩次交換就可以得到。
這題之前有人討論過,看完還是不解,不知道大家的想法如何。感謝!
--
Sent from my iPhone
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 42.71.126.67
推
02/19 16:28, , 1F
02/19 16:28, 1F
→
02/19 16:28, , 2F
02/19 16:28, 2F
推
02/19 16:59, , 3F
02/19 16:59, 3F
→
02/19 17:00, , 4F
02/19 17:00, 4F
推
02/19 17:04, , 5F
02/19 17:04, 5F
→
02/19 18:53, , 6F
02/19 18:53, 6F
→
02/20 01:38, , 7F
02/20 01:38, 7F
討論串 (同標題文章)