Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started