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

Comp 301: Data Structures  Question Paper

Comp 301: Data Structures  

Course:Bachelor Of Science In Computer Science

Institution: Chuka University question papers

Exam Year:2011



CHUKA UNIVERSITY

KAPKWEN@CU2014(0712 880 531)
UNIVERSITY EXAMINATIONS
THIRD YEAR EXAMINATION FOR THE AWARD OF THE DEGREE OF
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
COMP 301: DATA STRUCTURES
STREAM: BSc. (Comp. Science) Y3S1 TIME: 2 HOURS
DAY/DATE: MONDAY 1/8/2011 11.30 A.M. – 1.30 P.M.
INSTRUCTIONS:
1. Answer question ONE and any other two questions
2. Marks are awarded for clear and concise answers

Question One-30 marks (Compulsory)

(a) List TWO basic ways of representing linear structures in memory. [2 marks]
(b) Differentiate between functional and data abstraction while giving appropriate examples in Each. [4 marks]
(c) Outline THREE most common types of graph representation. [3 marks]
(d) Give TWO areas of application of each of the following data structures. [4 marks]
(i) Stack
(ii) Queue
(e) Write an algorithm to implement Quick sort. [5 marks]
(f) Give FOUR operations performed on a linked list. [4 marks]

(g) Discuss the following as used in data structures. [8 marks]
(i) Primitive vs Non-primitive data structures
(ii) Homogenous Vs Heterogenous data structures
(iii) Linear vs Non-linear data structures
(iv) State vs Association data structures

Question TWO-20 Marks
(a) Give one advantage and one disadvantage of each of the following data structures.
[10 marks]
(i) Array
(ii) Linked list
(iii) Binary tree
(iv) Heap
(v) Hash table
(b) Using a hash table, explain how hashing makes it easy to search an item from a long list.
[6 marks]
(c) While giving examples, differentiate between breadth first traversal and depth first traversal.
[4 marks]
Question THREE-20 Marks
(a) Draw a flow-chart to demonstrate the following operations on a stack. [6 marks]
(i) POP ( )
(ii) PUSH ( )
(b) Briefly describe ENQUEUE () and DEQUEUE operations on a Queue. [4 marks]
(c) Discuss the relevance of computer storage and data management in the study of datastructures and algorithms. [5 marks]
(d) Briefly describe;
(i) Binary tree and outline Two of its properties [3 marks]
(ii) Heap tree [2 marks]

Question FOUR-20 marks
(a) Write down the adjacency matrix for the graph below [5 marks]







(b) Write a program to enter in five dates, store this information in an array of structures.
[5 marks]
(c) Differentiate between;
(i) Sequential and binary search
(ii) Bubble sort and selection sort [4 marks]

(d) Give a recursive function that accepts the base,p,and power,q,entered from the keyboard as its input and computes and displays p raised to q(Pq). [6 marks]





Question FIVE-20 marks
(a) Given a 30 * 10 matrix, DATA, such that Base (DATA) =200 and that there are 8 words per memory cell.
(i) Explain how matrices of the same category as DATA are represented in the computer’s Memory. [2 marks]
(ii) What would be the address DATA [15, 5] if the storage method was;
- Row-major order
- Column-major order [6 Marks]

(b) Information held about a student at the admissions office comprises the record.

STUDREGNO REC NO NAME FACULTY DEPARTMENT SEX

(i) Give a STUCTURE type Definition STUDREC with the fields identified above.
[2 marks]
(ii) Declare a variable of type (STUDREC) which holds the information of individual student. [2 marks]
(c) Using the following weights, construct a Huffman tree {9, 4, 7, 2, 5, 14} [8 marks]

KAPKWEN@CU2014(0712 880 531)
--------------------------------------------------------------------------------------------------------------------








More Question Papers


Popular Exams



Return to Question Papers