Unit 14 Assignment (optional)#

Code exercises#

Here are some optional fun code exercises to practice thinking about algorithms. Choose any that look interesting to you. Make sure to write unit tests to verify that your code is behaving the way you expect it to.

Sorting#

  • Implement selection sort. Your function should take an ArrayList as input, and return another ArrayList with the same values sorted.

  • Implement insertion sort.

  • Implement bubble sort.

  • Implement merge sort.