BIT 3101A BBIT 106 BSD 2101 BISF 2102 BAC 2102 – DATA STRUCTURES AND ALGORITHMS KCA Past Paper

UNIVERSITY EXAMINATIONS: 2019/2020
EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE IN
INFORMATION TECHNOLOGY/ BUSINESS INFORMATION
TECHNOLOGY/ APPLIED COMPUTING/ SOFTWARE DEVELOPMENT/
INFORMATION SECURITY & FORENSCIS
BIT 3101A/ BBIT 106/ BSD 2101/ BISF 2102/ BAC 2102: DATA
STRUCTURES AND ALGORITHMS
FULL TIME/PART TIME/DISTANCE LEARNING
DATE: MAY, 2020 TIME: 6 HOURS
INSTRUCTIONS: Answer ALL Questions

SECTION II: PRACTICAL. 20 MARKS.
A retail business must file a monthly sales tax report listing the total sales for the month and the
amount of country and county sales tax collected. The country sales tax rate is 4 percent and the
county sales tax rate is 2 percent of the monthly sales. Design an algorithm in pseudo code and
flow chart (separately) for a program that asks the user to enter the total sales for the month then
calculate and display the following:
• The amount of county sales tax
• The amount of country sales tax
• The total sales tax (county plus country)
20 Marks
SECTION III: APPLICATION. 20 MARKS.
Chaining is a method of resolving Hashing Algorithm Conflicts. A hash algorithm is a calculation that is
applied to transform a key to an address(index). Supposing you are provided with the algorithm below:
eqn => add= key mod n
where add is the address or the index position in an array(where we would like to map our
item in the array)
key = sum of ASCII codes of the elements of an array. i.e for an array having the element
Moe M=77, o=111, e=101 total 289
mod = modulus operation
n is the size of the array
Question
Map the following 10 elements in an array by calculating their addresses using the algorithm above
resolving any conflicts using Chaining Method. Provide a diagram showing your answer to these.
1. Fox
2. Trot
3. Mode
4. Link
5. Milk
6. End
7. Joys
8. Nock
9. TCPIP
10. WEND
20 Marks

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

Written by