Question: Please help me with this assignment: Working with arrays and strings This exercise gets you work with arrays and strings. Remember that a string is
Please help me with this assignment:
Working with arrays and strings
This exercise gets you work with arrays and strings. Remember that a string is an array of
characters.
Get set up
Duplicate the Visual Studio files you need and start up Visual Studio.
Read in and sort a string
You are to write a program that inputs a string, sorts the characters in it and outputs it This is
a lot like a previous exercise you wrote, but a you must use a string, and b you must use a
Selection sort.
Some things to be aware of:
Start with your that used the Bubble sort. However, you need to compute the length of
the string before we assumed a length
Be aware of the size of the data you are working with. A character is a byte, while the
ECX is a bit word. Copying something that is a byte into the ECX will also copy
bytes that follow it
Remember the Selection sort. In Java:
void selectionSortint arr
int n arr.length;
for int i ; i n; i
Find the minimum element in unsorted array
int minidx i;
for int j i; j n; j
if arrj arrminidx
minidx j;
Swap the found minimum element with the first
element
int temp arrminidx;
arrminidx arri;
arri temp;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
