Get premium membership and access revision papers, questions with answers as well as video lessons.

Comp 123/Inte 123: Data Structure Question Paper

Comp 123/Inte 123: Data Structure 

Course:Bachelor Of Computer Science

Institution: Kabarak University question papers

Exam Year:2013



KABARAK
UNIVERSITY
UNIVERSITY EXAMINATIONS
2012/2013 ACADEMIC YEAR
FOR THE DEGREE OF BACHELOR OF SCIENCE IN
COMPUTER SCIENCE

COMP 123/INTE 123: DATA STRUCTURE
DAY: THURSDAY




DATE: 11/04/2013
TIME: 2.00 – 4.00 P.M.

STREAM: Y1S2
INSTRUCTIONS:
1. This question paper has five questions
2. QUESTION ONE IS COMPULSORY AND HAS 30 MARKS
3. Answer any other two questions worth 20 marks

QUESTION ONE (30 marks)
(a) What is complexity analysis? Give the parameters used to measure each of the
complexity analysis forms






(5mks)
(b) Which type of linked list provides traversal of items in any direction from any
node? Show with the diagram





(3mks)
(c) Explain overflow in stack and how to test this condition in C language
(3mks)
(d) What is the index position of any top of stack if n is the number of elements










(2mks)
(e) If the index position of the rear and the front of the queue are 0 and -1
respectively, how many elements are there in that queue?

(4mks)
(f) How do you handle a situation where a hash function produces the same result of
the position of index in the list of elements? Explain


(4mks)
(g) What is a pointer? Explain the use of pointer in linked list

(2mks)
(h) Write a code in C to declare the following elements into one dimensional array
and show their respective index positions; A, B, C, D


(5mks)
(i) What is the importance of including the base case in a recursive function? (2mks)



QUESTION TWO (20 marks)
(a) How do you represent a graph in computer memory? Demonstrate it with the use
of appropriate diagram of five vertices




(5mks)
(b) Demonstrate recursion in a Fibonacci series showing the base case and a
recursive case







(4mks)
(c) What is a heap? Differentiate between descending and ascending heap
(3mks)
(d) What is an array? Explain how to declare and initialize two-dimensional array in
C language.







(5mks)
(e) Explain underflow in stack and how to test this condition in C language (3mks)


QUESTION THREE (20 marks)
(a) If h is the height of the tower representing the number of disks and A B and C
representing the three rods, explain the steps of using the minimal moves in
playing the Tower of Hanoi puzzle




(6mks)
(b) How do you implement stack using an array



(2mks)
(c) Demonstrate deletion of a node having two children.


(5mks)
(d) What is a binary tree? Explain symmetric order in binary tree

(5mks)
(e) What is the difference between a tree and a graph?


(2mks)


QUESTION FOUR (20 marks)
(a) Write a code in C to define a queue declared as an array

(2mks)
(b) A perfect binary tree structure is build with seven nodes.
i. How many edges are contained in the tree?
(2mks)
ii. What is the height of the tree?


(2mks)

(c) What are the limitations of linear queue? How can they be rectified?
(3mks)
(d) Using an example of a 4x3 matrix with integer values, show the respective index
position of each element in the matrix (2mks)
(j) Transform the following expressions into prefix and postfix
(A+B)*(C+D)/E+F






(4mks)
(e) Explain searching of a value in binary search tree


(5mks)






More Question Papers


Popular Exams



Return to Question Papers