report.txt 1.4 KB

1234567891011121314151617181920212223242526272829
  1. Stephen Corya
  2. 00255-99127
  3. ECE 368
  4. PA01 Report
  5. The sequence generation algorihthm generates a sequence based on a max
  6. value "N". It stores a number of integers equal to the sum of the sequence
  7. from one to logarithm base-3 of N with increments of one.
  8. If one imagines the triangle created by 2^p*3^q, it can be thought of as
  9. the total number of digits in the triangle. Because p+q equals the
  10. number of operations performed in a given row of the triangle and
  11. becuase p+q is also to the row number of any given row, the runtime
  12. complexity of the sequence generation algorithm is equal to O(logsub3
  13. (N)^2).
  14. Running the program with an insertion sort on 10.txt gives us 54
  15. comparisons and 99 moves. The same file sorted with a selection sort gives
  16. us 151 comparisons and 114 moves. The same program sorting 1000.txt gives
  17. us 3.071800e+04 comparisons and 5.669300e+04 moves when run using
  18. insertion sort and 1.199791e+07 comparisons and 7.783800e+04 moves when
  19. run using selection sort. These values increase exponentially as the size
  20. of the array to be sorted increases. The runtime complexity of the insertion
  21. algorithm is approximately equal to O(log(N)*log(N)), as noted in many
  22. previous studies. The runtime complexity of the selection algorithm
  23. is significantly greater than its inserting counterpart.
  24. When run in either insertion or selection mode, the program uses
  25. approximately one byte of memory per number in the array.