[姆咪] Next Permutation
https://leetcode.com/problems/next-permutation/
permutation本質是一種樹
比方說{1,2,3}的所有permutation是
x
/ | \
1 2 3
/ \ / \ / \
2 3 1 3 1 2
| | | | | |
3 2 3 1 2 1
這樣解題思路就清楚了
--
我朋友0 https://i.imgur.com/ZjPRKHj.jpg












--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.240.35.26
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1555241215.A.70F.html
※ 編輯: Apache (111.240.35.26), 04/14/2019 19:27:26
推
04/14 19:29,
6年前
, 1F
04/14 19:29, 1F
→
04/14 19:30,
6年前
, 2F
04/14 19:30, 2F
→
04/14 19:30,
6年前
, 3F
04/14 19:30, 3F
→
04/14 19:31,
6年前
, 4F
04/14 19:31, 4F
→
04/14 19:31,
6年前
, 5F
04/14 19:31, 5F
→
04/14 19:45,
6年前
, 6F
04/14 19:45, 6F
→
04/14 19:45,
6年前
, 7F
04/14 19:45, 7F
→
04/14 19:51,
6年前
, 8F
04/14 19:51, 8F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):