This program implements a stack Java sorting solution which sorts integers submitted by the user from smallest to largest.
This program can be used to sort through a large list of integers. For example, collecting a list of student birth dates to understand how many students are born in the same number (day of the month).
- Error Handling. The program will only accept positive or negative integers.
- Uses Keyword 'done' to follow through with the sorting process.
- Uses a loop to continue asking the end user for intergers until the sorting keyword is entered.
- Returns sorted array with a descriptions stating "Sorted Stack"
-Run the code directly from your Java compiler or find one online. -The program will start by displaying "Enter the numbers you wish to add (separated by spaces), then press enter: " -The program will end by displaying the sorted list of numbers.
Input: Enter the numbers you wish to add (separated by spaces), then press enter: 56 12 78 22 45
Add more numbers (separated by spaces), or enter 'done' to sort your list: done
Output: Sorted Stack (Smallest to Largest): 78 56 45 22 12
Collaboration or Reuse are welcome. Feel free to open an issue to the dicuss the changes you are looking to make.