Spec init(){ Spec s; s.size = SIZE; s.len = LENGTH; s.arr = new int(s.size); s.shuffle = &shuffle; s.shuffle(s); return s; }
void sort(const char* name, void (*sort_f)(Spec&), Spec& s, bool is_print){ if(is_print){ cout << "First " << name << " status: "; display_array(s); } clock_t begin_time = clock(); sort_f(s); cout << "Last " << name << " status(" << float( clock () - begin_time ) / CLOCKS_PER_SEC << ") "; if(is_print) display_array(s); s.shuffle(s); }