Hit: Computer Science Iii Question Paper
Hit: Computer Science Iii
Course:Diploma In Health Records And Information Technology
Institution: The Presbyterian University Of East Africa question papers
Exam Year:2016
PRESBYTERIAN UNIVERSITY OF EAST AFRICA
NAKURU CAMPUS
SCHOOL : DEPARTMENT OF COMPUTER SCIENCE AND IT
PROGRAM : DIPLOMA IN HEALTH RECORDS AND IT
COURSE CODE : HIT
COURSE TITLE : COMPUTER SCIENCE III
DATE : APRIL, 2016 (7 STUDENTS)
Read the instructions carefully:
i. Mobile Phones ARE NOT allowed in the examination room
ii. Time allowed is 2 hours
iii. No bags OR reference material of any kind should be in the examination room
iv. Answer questions ONE and any other TWO questions
v. Do not write on the question paper. Any rough work should be written at the back of the examination booklet and crossed through.
vi. Only registration numbers should appear on the booklet.
vii. Writing a name on the booklet will lead to cancellation of unit.
This paper contains 3 printed pages
QUESTION ONE (30 MARKS)
a) Define the following terms: (10 marks)
i. Abstract data type
ii. Data object
iii. Algorithm
iv. Abstraction
v. Program
b) Write an algorithm to receive a base ten number and convert it into its binary equivalent using a stack. (5 Marks)
c) What is Documentation? Briefly describe the information contained in a Documentation document. (8 marks)
d) Briefly outline the algorithm for an insertion sort implementation. (7 marks)
QUESTION TWO (15 MARKS)
a) You wish to implement a patient scheduling system for a hospital. State the data structure you would use and explain why. (4 marks)
b) Explain three applications of stacks in computer science. (3 Marks)
c) A queue can be implemented as either an array or a linked list. In the linked list implementation, it is not necessary to check whether the queue is full, whereas this is essential in the array implementation. Briefly explain why this is the case. (4 marks)
d) Briefly describe the two basic operations a queue ADT. (4 marks)
QUESTION THREE (15 MARKS)
a) Define a linked list ADT (3 marks)
b) Give two differences between a linked list and an array (4 marks)
c) With the help of a relevant illustration, describe the steps you would take to delete the last node from a linked list. (4 marks)
d) Briefly describe the two basic operations a list ADT (4 marks)
QUESTION FOUR (15 MARKS)
a) Briefly describe the two basic operations on a stack (4 marks)
b) Assume a linear list represented by the array a[b] – for storing b integers, but currently having c values (where c<=b).
i. Write an algorithm to insert an element d into position e of the list. (6 Marks)
ii. Write an algorithm to receive a position d and then remove and return the element in that position. (3 Marks)
c) State two applications of a tree data structure (2 marks)
QUESTION FIVE (15 MARKS)
a) Briefly describe how to access values in a linked list (5 Marks)
b) Assume you have a linked list storing the following elements: 1, 3, 5, 8, 10. List the steps of doing the following.
i. Removing element 8 from the list. (3 marks)
ii. Inserting element 4 between elements 3 and 5. (2 Marks)
c) Using the binary search as an example, describe the recursive and stopping cases of a recursive procedure. (5 marks)
More Question Papers
Exams With Marking Schemes