摘要: Description Given an unsorted integer array, find the smallest missing positive integer. Example 1: Example 2: Example 3: Note: Your algorithm should 阅读全文
posted @ 2020-04-10 19:48 bw98 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Description Shuffle a set of numbers without duplicates. Example: 思路 分析洗牌算法正确性的准则:产生的结果必须有 n! 种可能,否则就是错误的。这个很好解释,因为一个长度为 n 的数组的全排列就有 n! 种,也就是说打乱结果总共有 阅读全文
posted @ 2020-04-10 01:18 bw98 阅读(179) 评论(0) 推荐(0) 编辑