You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
777 B

6 years ago
  1. // The SortingAlgs class that implements insertion sort and iterative merge sort
  2. // your name here
  3. public class SortingAlgs
  4. {
  5. // card comparison
  6. public int compares(Card c1, Card c2)
  7. {
  8. // TODO: implement this method
  9. return -1; // replace this statement with your own return
  10. }
  11. // insertion sort
  12. public void insertionSort(Card[] cardArray)
  13. {
  14. // TODO: implement this method}
  15. }
  16. // merge sort
  17. public void mergeSort(Card[] cardArray)
  18. {
  19. // TODO: implement this method (in an iterative way)
  20. }
  21. // merge two sorted arrays into one sorted array
  22. public void merge(Card[] cardArray, int first, int mid, int last)
  23. {
  24. // TODO: implement this method
  25. }
  26. }