Skip to content

Commit

Permalink
Update 41.First Missing Positive.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bugsource authored Jul 28, 2019
1 parent 5cc9973 commit 107da89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 41.First Missing Positive.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#题目描述
# 题目描述

#**思路**
## 思路
1、基本思路是桶排序;如果元素的大小在范围内(1~n),则检查下数组中对应的桶位置的数字是否和此元素相等,不相等则交换,交换完以后必须继续检查原位置的数字是
否需要交换(如果直接循环变量自增不检查的话,会导致该元素没有机会再被放到正确位置上),直至不需要交换后,循环变量自增;
2、临时变量存储优化有作用,提升1ms。
Expand Down

0 comments on commit 107da89

Please sign in to comment.