标签:include names -- bsp cpp for solution AC public
solution.h:
#include <vector>
using namespace std;
class Solution
{
public:
void insertSort(vector<int>& vec);
};
solution.cpp:
#include "solution.h"
void Solution::insertSort(vector<int>& vec)
{
for(int i = 1; i < vec.size(); i++)
{
int key = vec[i];
int j = i - 1;
while(j >= 0 && vec[j] > key)
{
vec[j+1] = vec[j];
j--;
}
vec[j+1] = key;
}
}
标签:include names -- bsp cpp for solution AC public
原文地址:https://www.cnblogs.com/cccv/p/9170383.html