College of Computing and InformaticsAssignment 1
Deadline: Thursday 14/10/2021 @ 23:59
[Total Mark for this Assignment is 5]
Student Details:
Name: ###
ID: ###
CRN: ###
Instructions:
•
•
•
•
•
•
•
•
•
•
You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
It is your responsibility to check and make sure that you have uploaded both the correct files.
Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets or languages other than English or any kind of
manipulation).
Email submission will not be accepted.
You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
You must use this template, failing which will result in zero mark.
You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
Late submission will result in ZERO mark.
The work should be your own, copying from students or other resources will result in ZERO mark.
Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s): LO3
Calculate and
analyze the
complexity of
small to medium
programs built
with basic data
structures.
Question One
1.5 Marks
Write a recursive function code in Java to find the value of x!. Analyse its running
time.
Answer:
Question Two
Pg. 02
Learning
Outcome(s): LO1
Describe basic
and advanced
data structures
such as linked
lists, stacks, and
queues.
Question Two
1.5 Mark
Write a program using LinkedList and ListIterator to obtain the following statements:
1. Create a linked list named “lst” with these elements: “one”, “four” “three”, and
“five.
2. Create a list iterator named “iter1” related to “lst”.
3. Add the new element “two” after the element “one”.
4. Remove the elements “four” and “five”.
5. Display all the remaining elements of the list.
Output sample:
[one, four, three, five]
[one, two, four, three, five]
[one, two, three]
Answer:
Question Three
Pg. 03
Learning
Outcome(s): LO5
Evaluate data
structures for
efficient data
representation
and organization
with
demonstrable
results.
Question Three
2 Marks
Write a recursive Java function to find the minimum and the maximum element in an
array. Verify that your function is correct.
Answer: