Exam Paper C 2022S1
Exam Paper C 2022S1
YEAR: 2022
SEMESTER: 1
ASSESSMENT: C
SPECIAL REQUIREMENTS
NONE
NON-PROGRAMMABLE POCKET CALCULATOR
SCIENTIFIC CALCULATOR
COMPUTER ANSWER SHEET
GRAPH PAPER
DRAWING INSTRUMENTS
OTHER: COMPUTER
ANSWER BOOK
Theory
a. Use the answer book to answer questions.
b. Show all steps where applicable.
c. Write legibly
Practical
a. Use Java/C++ to create the programs required in section 2
b. Write your code legibly and provide comments
c. To evidence your output, capture the output of all the various functionality requirements into a word
document (correctly numbered) and save it as PDF at the end.
d. You are then required to put the PDF output file and the associated code into a zip file and send to Lecture PC.
Question 1 [15]
1.1 Identify the following structures and briefly describe their characteristics.
1.1.1 (3)
1.1.2 (3)
1.1.3 (3)
1.2 What is the formula for determining the position of the left child node? (3)
1.3 At what point or position does the deletion of elements in a heap tree take place from? (1)
Question 2 [10]
2.2 Which data structure uses a Last in First out (FIFO) approach? (1)
2.3 The Department of Chaos want to implement a ticketing system to manage operations for people coming in
to receive services. The ticketing system needs to take into account people with special circumstances.
2.3.2 Why did you choose the data structure above? (2)
2.3.3 What are the two different types of ordering approaches with the data structure chosen?
(2)
3 DTD117V – Paper C (2022S1)
Question 3 [25]
3.2 Use Huffman encoding to compress the text below. Show all the steps. (10)
3.3 Discuss two methods that can be used to resolve collisions in hash tables. (5)
Question 4 [20]
4.1 Turn the steps below into java code to implement the AVL Tree Insertion by using the recursive Binary Search
Tree. (20)
Develop a java program that uses two integer stack data structures. The main stack should be called OddNum and
the second should be called Temp. Perform the following operations:
5.1 Create and initialise the OddNum stack with the following values: 55, 47, 91, 39, 21, 13, 7, and 15 using the
appropriate function. Each initialisation operation should display a message such as “value XX added into
stack OddNum”. (5)
5.3 Delete value 21 from the OddNum stack. For each operation resulting in the deletion and restoration of the
stack, display a message to that effect. You may need to also utilise the Temp stack for this operation.
(7)
5.4 Increment the value 7 by 4. Use display messages to show each operation on the relevant stack or stacks.
(4)
5.7 Ensure that the program is well written, properly commented and the output neatly displayed. (3)
The End