- A method should accept an array to sort from the user. The size of the array is also to
be determined by the user. Use Input Box’s for this functionality – one to get the size of
the array and then one for each string in the array.
- You need to display the content of the array in an output text box before and after the
- The program should also display the partially sorted solutions of the array as well.
These partial steps should clearly show how the algorithm sorts elements of the array.
So what I have so far, is for the setting the array system. The ReDim would be setting the array right?
Dim Numbers() As Integer Dim value As Integer = InputBox("Enter size of Array", "Array Size", 0) Dim value2 As Integer = InputBox("Enter numbers in your Array", "Numbers in Array", 0) ReDim Numbers(value - 1)
Now I have an example of the sorting array system that doesn't include the inputboxes, so I tried to change it to incorporate them, but the outcome isn't working correctly.
txtOutput.Text = "Unsorted array: " & vbCrLf For Each i As Integer In Numbers Numbers(value - 1) = value2 txtOutput.Text &= i & vbTab Next i txtOutput.Text &= vbCrLf & "Sorted array: " & vbCrLf mergeSort(Numbers, 0, Numbers.Length - 1) For Each i As Integer In Numbers txtOutput.Text &= i & vbTab Next