We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
free
delete
1 parent 77518ee commit e2996ceCopy full SHA for e2996ce
sorting/shell_sort2.cpp
@@ -134,8 +134,8 @@ void test_int(const int NUM_DATA) {
134
// the standard results
135
}
136
137
- free(data);
138
- free(data2);
+ delete[] data;
+ delete[] data2;
139
140
141
/**
@@ -175,8 +175,8 @@ void test_f(const int NUM_DATA) {
175
176
177
178
179
180
181
182
/** Main function */
@@ -229,6 +229,6 @@ int main(int argc, char *argv[]) {
229
double elapsed_time = (end - start) * 1.f / CLOCKS_PER_SEC;
230
std::cout << "Time spent sorting: " << elapsed_time << "s\n" << std::endl;
231
232
233
return 0;
234
0 commit comments