UNIVERSITY EXAMINATIONS: 2019/2020
EXAMINATION FOR DIPLOMA IN INFORMATION
TECHNOLOGY
DIT 307: DATA STRUCTURES AND ALGORITHMS
ORDINARY EXAMINATIONS
MODE: FULL TIME/PART TIME
DATE: MAY, 2020 TIME: 6 HOURS
INSTRUCTIONS: Answer ALL Questions.
SECTION B: (20 MARKS)
(a) Construct a hash table to store the integers 13, 2, 34, 56, 77,21,33,82 using a suitable hash
function that adequately resolves any conflict an ensures that all values are stored in the
hash table (10Marks)
(b) Describe the procedure for constructing a binary search tree (BST). (10 Marks)
SECTION C: (20 MARKS)
(a) Given the following, cost = 400 and selling price = 4500, perform a dry run for the following
pseudocode (10Marks)
(b) Perform an analysis and write a program in c/c++ using an array, that request two input from
user, store the inputs in the arrays and finally display the sum of the two inputs. (10Marks)