Escolar Documentos
Profissional Documentos
Cultura Documentos
2>
Qualification
Assignment due
16-08-2016
Learners name
Assignment submitted
27-09-2016
Assessor name
Learner declaration:
I certify that the work submitted for this assignment is my own and research sources are fully acknowledged.
Learner signature
Date
27-09-2016
Grading grid
P3.
1
P3.
2
M1
M2
M3
D1
D2
D3
Assignment title
In this assignment, you will have opportunities to provide evidence against the following criteria.
Indicate the page numbers where the evidence can be found.
Assessment criteria
Expected evidence
Task
no.
Assessors Feedback
1.1
1.2
Assessment criteria
Expected Evidence
Feedback
(note on Merit/Distinction if applicable)
Summative feedback
Assessors
Signature
Date
3.1 Explain and give examples about String operations like concatenation, find
character, length, lowercase, substring, trim, etc.
hello string
hello
}
3.2 Write algorithms or programs to demonstrate String Operations
In this case, I use LSD algorithm to arrange the following numbers (in string
representations) in ascending order: 158, 124, 238, 707, 608, 250,
888. The algorithm is
public class LSD_Sort {
public static void sort(String[] a, int w) {
int n = a.length;
int R = 256; // extend ASCII alphabet size
String[] aux = new String[n];
for (int d = w-1; d >= 0; d--) {
// sort by key-indexed counting on dth character
Input
(w=3)
158
124
238
707
608
250
888
d=2
250
124
707
158
238
608
888
d=1
d=0
Output
608
707
124
238
158
250
888
124
158
238
250
608
707
888
124
158
238
250
608
707
888
10