Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ofstream outputfile;
- outputfile.open(output_filename.c_str());
- outputfile << "Name of the input file: " << input_filename << endl;
- outputfile << "Number of lines in the input file: " << num_of_lines << endl << endl;
- outputfile << "Linear Search (No Sorting)" << endl;
- outputfile << "Number of comparisons: " << num_of_comps_search[0] << endl;
- outputfile << "Search value: " << search_value << endl;
- outputfile << "Search value was found: " << is_search_value_found[0] << endl << endl;
- outputfile << "Linear Search with Bubble Sort" << endl;
- outputfile << "Number of bubble sort swaps: " << num_of_swaps[0] << endl;
- outputfile << "Number of linear search comps: " << num_of_comps_search[0] << endl;
- outputfile << "Number of bubble sort comps: " << num_of_comps_sort[0] << endl;
- outputfile << "Total number of comps: " << num_of_comps_total[0] << endl;
- outputfile << "Search value: " << search_value << endl;
- outputfile << "Search value was found: " << is_search_value_found[0] << endl << endl;
- outputfile << "Linear Search with Selection Sort" << endl;
- outputfile << "Number of selection sort swaps: " << num_of_swaps[1] << endl;
- outputfile << "Number of linear search comps: " << num_of_comps_search[1] << endl;
- outputfile << "Number of selection sort comps: " << num_of_comps_sort[1] << endl;
- outputfile << "Total number of comps: " << num_of_comps_total[1] << endl;
- outputfile << "Search value: " << search_value << endl;
- outputfile << "Search value was found: " << is_search_value_found[1] << endl << endl;
- outputfile << "Binary Search with Bubble Sort" << endl;
- outputfile << "Number of selection sort swaps: " << num_of_swaps[2] << endl;
- outputfile << "Number of linear search comps: " << num_of_comps_search[2] << endl;
- outputfile << "Number of selection sort comps: " << num_of_comps_sort[2] << endl;
- outputfile << "Total number of comps: " << num_of_comps_total[2] << endl;
- outputfile << "Search value: " << search_value << endl;
- outputfile << "Search value was found: " << is_search_value_found[2] << endl << endl;
- outputfile << "Binary Search with Selection Sort" << endl;
- outputfile << "Number of selection sort swaps: " << num_of_swaps[3] << endl;
- outputfile << "Number of linear search comps: " << num_of_comps_search[3] << endl;
- outputfile << "Number of selection sort comps: " << num_of_comps_sort[3] << endl;
- outputfile << "Total number of comps: " << num_of_comps_total[3] << endl;
- outputfile << "Search value: " << search_value << endl;
- outputfile << "Search value was found: " << is_search_value_found[3] << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement