BBIT106-BIT3101A – DATA STRUCTURES AND ALGORITHMS.

UNIVERSITY EXAMINATIONS: 2017/2018
EXAMINATION FOR DEGREE OF BACHELOR SCIENCE/BUSINESS
INFORMATION TECHNOLOGY
BBIT 106/BIT 3101A: DATA STRUCTURES AND ALGORITHMS
MODE: FULL TIME/PART TIME/DISTANCE LEARNING
ORDINARY EXAMINATIONS
DATE: JULY.2018 DURATION: 2 HOURS
INSTRUCTIONS: Answer Question ONE and any other TWO questions

QUESTION ONE [30 MARKS]
a) Describe the steps for designing an algorithm.
5 Marks
b) Differentiate between a walk through and a desk check as used in testing the algorithm.
4 Marks
c) Describe the algorithms for each of the following operations performed in a linked list data structure:
i. Delete a node from the middle
ii. Insert a node at the beginning
6 Marks
d) Discuss how heuristic algorithms work and give two examples.
5 Marks
e) Design an algorithm to store patient number, name and consultation fee in a structure called
PATIENT. The design should allow users to key in all the values (patient number, name and
consultation fee) for ten (10) patients and then display the total fee chargeable to all the patients.
7 Marks
f) Describe linear probing as one of the techniques for solving collisions in a hash table.
3 Marks
QUESTION TWO [20 MARKS]
a) Design an algorithm using a pseudo code that uses a selection structure to prompt the user to enter a
grade then display the remarks using the criteria below.
Grade      Remark
A              Excellent
B              Very good
C               Good
D                Fair
E                 Fail
8 Marks
b) Describe any three rules used to estimate the big O value for a complexity f(n) were n is the size of
input.
6 Marks
c) Briefly describe why algorithm analysis is necessary.
6 Marks
QUESTION THREE [20 MARKS]
a) Briefly explain how array elements can be accessed.
4 Marks
b) Explain the difference between static and dynamic arrays.
4 Marks
c) Design an algorithm to swap two variables using a flowchart.
4 Marks
d) Design an algorithm using a pseudo code to calculate and display average score for forty scores keyed
in by the user.
8 Marks
QUESTION FOUR [20 MARKS]
a) Define a queue ADT and hence explain any three applications of a queue.
6 Marks
b) Define a stack ADT and hence outline any three operations performed on a stack.
4 Marks
c) Discuss the sufficient conditions for a heap abstract data type
4 Marks
d) Construct a binary search tree to store the names of wildlife animals below
Lion, Giraffe, Elephant, Kangaroo, snake, monkey and Zebra.
6 Marks
QUESTION FIVE [20 MARKS]
a) Design an algorithm using pseudo code to sort elements by insert sort technique.
5 Marks
b) Design an algorithm using pseudo code to search elements in an array of size n by linear search.
5 Marks
c) Describe the algorithm for depth first search traversal in a graph.
6 Marks
d) Briefly explain the two techniques of representing graph ADT.
4 Marks

(Visited 111 times, 1 visits today)
Share this:

Written by