- Introduction to Challenges
- Insertion Sort 1
- Insertion Sort Itself
- Correctness and the Loop Invariant
- Running Time
Counting Sort 1
- Simple Counting Sort
- Prepare for Full Counting Sort
- The Full Counting Sort
- Simple Quick Sort
- Quick-Sort Advanced
- Quick Sort Running Time
Input Format for standard Sorting Challenges:
- t - the number of test cases
- s - the size of the array
- ar - the list of integers
Introduction to Challenges
These challenges will have a similar input format, which will come in on the Standard Input (STDIN). You need to print your solution to the Standard Output (STDOUT).
You will be provided with boilerplate code which processes the input into arrays and passed them to the method
doStuff. To reload the boilerplate, you can click on "Reset Code" below.
This is a simple challenge to get used to the interface. For each list of numbers you are given as input can you output the sum of the list?
The input for these challenges will follow the format summarized in the sidebar. The first line will contain T, the number of test cases. Each test case will contain 2 lines:
N - the number of elements in a list.
N numbers will follow.
Output the sum of each list of integers on its own line.