Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. ofstream outputfile;
  2. outputfile.open(output_filename.c_str());
  3. outputfile << "Name of the input file: " << input_filename << endl;
  4. outputfile << "Number of lines in the input file: " << num_of_lines << endl << endl;
  5. outputfile << "Linear Search (No Sorting)" << endl;
  6. outputfile << "Number of comparisons: " << num_of_comps_search[0] << endl;
  7. outputfile << "Search value: " << search_value << endl;
  8. outputfile << "Search value was found: " << is_search_value_found[0] << endl << endl;
  9. outputfile << "Linear Search with Bubble Sort" << endl;
  10. outputfile << "Number of bubble sort swaps: " << num_of_swaps[0] << endl;
  11. outputfile << "Number of linear search comps: " << num_of_comps_search[0] << endl;
  12. outputfile << "Number of bubble sort comps: " << num_of_comps_sort[0] << endl;
  13. outputfile << "Total number of comps: " << num_of_comps_total[0] << endl;
  14. outputfile << "Search value: " << search_value << endl;
  15. outputfile << "Search value was found: " << is_search_value_found[0] << endl << endl;
  16. outputfile << "Linear Search with Selection Sort" << endl;
  17. outputfile << "Number of selection sort swaps: " << num_of_swaps[1] << endl;
  18. outputfile << "Number of linear search comps: " << num_of_comps_search[1] << endl;
  19. outputfile << "Number of selection sort comps: " << num_of_comps_sort[1] << endl;
  20. outputfile << "Total number of comps: " << num_of_comps_total[1] << endl;
  21. outputfile << "Search value: " << search_value << endl;
  22. outputfile << "Search value was found: " << is_search_value_found[1] << endl << endl;
  23. outputfile << "Binary Search with Bubble Sort" << endl;
  24. outputfile << "Number of selection sort swaps: " << num_of_swaps[2] << endl;
  25. outputfile << "Number of linear search comps: " << num_of_comps_search[2] << endl;
  26. outputfile << "Number of selection sort comps: " << num_of_comps_sort[2] << endl;
  27. outputfile << "Total number of comps: " << num_of_comps_total[2] << endl;
  28. outputfile << "Search value: " << search_value << endl;
  29. outputfile << "Search value was found: " << is_search_value_found[2] << endl << endl;
  30. outputfile << "Binary Search with Selection Sort" << endl;
  31. outputfile << "Number of selection sort swaps: " << num_of_swaps[3] << endl;
  32. outputfile << "Number of linear search comps: " << num_of_comps_search[3] << endl;
  33. outputfile << "Number of selection sort comps: " << num_of_comps_sort[3] << endl;
  34. outputfile << "Total number of comps: " << num_of_comps_total[3] << endl;
  35. outputfile << "Search value: " << search_value << endl;
  36. outputfile << "Search value was found: " << is_search_value_found[3] << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement