DBT 1301 Data Structures Algorithms December 2019 PDF
DBT 1301 Data Structures Algorithms December 2019 PDF
Instructions
1. This examination consists of FIVE questions.
2. Answer Question ONE (COMPULSORY) and any other TWO questions.
3. Do not write on the question paper.
QUESTION ONE: COMPULSORY (30 Marks)
A. Discuss how space and time is understood and studied in computing in relation to
algorithms (2 Marks)
B. List and explain any three areas in which data structures and algorithm studies knowledge
are applied. (3 Marks)
G. For every given real world problem there exists different algorithms to solve it however
some algorithms are better than others.
i. What name is given to the technique used to choose between algorithms using
theoretical calculations? (1 mark)
ii. The above technique uses seven functions to measure algorithm growth rates.
Provide the values for the missing letters in the table below in relation to the
seven functions (3 marks)
1 1 1 1 ____D____ 1 1 2
2 1 1 2 ____E____ 4 8 4
4 1 2 4 ____F____ 16 64 16
8 1 3 8 24 64 512 256
16 ____A____ 4 16 64 256 4069 ____G____
32 ____B____ 5 32 160 1024 32768 ____H____
64 ____C____ 6 64 384 4069 262144 ____I____
Page 2 of 5
iii. Explain why algorithms that have an exponential runtime are not currently
considered as a computational solution though they may exist mathematically
(2 marks)
A company has a database containing a column of customer ages and they have hired you to
develop a search algorithm to efficiently locate a given age number:
I. Using Linear search algorithm as the search techniques demonstrate how you would
search for the value 31 from the below dataset (5 marks)
10 14 19 26 27 31 33 35 42 44
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
I. Without carrying out asymptotic calculations, predict the time complexity of linear
search algorithm in the worst case (1 mark)
II. From your workings above, generate a pseudocode for Linear Search Algorithm (5
marks)
III. Compare Linear vs Binary Search Algorithms in terms of their complexity (4 marks)
I. State the type of traversal algorithm in trees ADT relevant for the following applications:
(3 marks)
i. Disk formatting
ii. File searching
iii. Arithmetic evaluation
II. Draw the expression tree for the following equation using mathematical knowledge (7
Marks)
6 3 ∗ 3 1
∗ 10
13 0.3 3 2 ∗9
Page 3 of 5
III. List any three application of tree data structures in computing technology (3 marks)
IV. What is the computational expense when performing a search in a binary tree ADT and
why? (2 marks)
I. Data Structures Holdings Company has a list of customers, which they wish to sort
in ascending order to lower the search time. Below is a section of the column in their
unsorted database. Sort it using the efficient Quick Sort Algorithm showing the result
in every given iteration (8 marks)
II. Without performing Big Oh calculations, state the computational expense of Quick Sort
Algorithm. (1 mark)
III. Explain to Lucien, the CEO of DS Holdings, why Quick Sort Algorithm is more
efficient than all other current sorting algorithms (3 marks)
IV. Name any three other sorting algorithms apart from Quicksort (3 marks)
Page 4 of 5
Page 5 of 5