标签:tor while ++ pre color nbsp log 算法 笔记
2.1-2
1 void insert_sort(vector<int> &v) 2 { 3 for (int i = 1; i < v.size(); ++i) 4 { 5 int key = v[i]; 6 int j = i - 1; 7 while (j >= 0 && key > v[j]) 8 { 9 v[j + 1] = v[j]; 10 --j; 11 } 12 v[j + 1] = key; 13 } 14 }
标签:tor while ++ pre color nbsp log 算法 笔记
原文地址:http://www.cnblogs.com/jily/p/6133560.html