Assignment 1 Front Sheet: Qualification BTEC Level 5 HND Diploma in Computing Unit Number and Title Submission Date
Assignment 1 Front Sheet: Qualification BTEC Level 5 HND Diploma in Computing Unit Number and Title Submission Date
Unit number and title Unit 19: Data Structures and Algorithms
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P1 P2 P3 M1 M2 M3 D1 D2
Summative Feedback: Resubmission Feedback:
IV Signature:
P3:
To demonstrate the usage of ADT, there is the sample problem that requires a program that is able to
find the maximum of a list of given numbers. In some case, the given numbers are just too many and it’s
very difficult to determine which is the largest value in the list of numbers. Therefore, it’s easier by
putting those numbers in an array. Since then, the logic to find out the largest number is in the figure
below:
Each element in an array can be only located by their numerical order, but it isn’t necessary to
remember their order in order to find them out, just put a variable that represents the numerical order
of array and update the variable each loop until it reaches the limit of the array it will stop.
Inside the loop, there is conditional statement that compare each element of the array to the
“temporary” largest number that derived from the first element of the array. So there will be two
outcome that may happen: firstly, the “temporary” maximum number is largest among those numbers,
so the program will just print it into the screen; secondly, the program found another value that larger
than the “temporary” max number so that value will replace it until there are no larger number left, then
print it into the screen.
That way, the program is able to find the maximum numbers among the given numbers.