Data Structures Question Paper
Data Structures
Course:Bachelor Of Education (Science)
Institution: Kabarak University question papers
Exam Year:2010
Page 1 of 2
KABARAK UNIVERSITY
UNIVERSITY EXAMINATIONS
2010/2011 ACADEMIC YEAR
FOR THE DEGREE OF BACHELOR OF EDUCATION SCIENCE
COURSE CODE: COMP 123
COURSE TITLE: DATA STRUCTURES
STREAM: SESSION III
DAY: MONDAY
TIME: 9.00 – 11.00 P.M
DATE: 29/11/2010
INSTRUCTIONS:
1. This question paper has four questions
2. Question ONE is compulsory and has 30 marks
3. Answer any other two questions worth 20 marks
PLEASE TURN OVER
Page 2 of 2
QUESTION ONE (30 MARKS)
(a) What is top of stack (2mks)
(b) What is complexity analysis? Give two forms of complexity analysis with
examples. (5mks)
(c) Explain how you can use array in stack representation (3mks)
(d) List any three algorithms used in sorting (3mks)
(e) What are the operations in stack? Explain any two (2mks)
(f) What is a pointer? Explain indirection (2mks)
(g) Explain best, worst and average analysis of an algorithm (3mks)
(h) What is a tree? Explain with the aid of a diagram father, sons, ancestors,
descendants and brothers in binary tree (5mks)
(i) Write a program in C to input the following elements into one dimensional array
and display them vertically; 4, 6, 7, 3, 9 (5mks)
QUESTION TWO (20 MARKS)
(a) What is a heap? Differentiate between descending and ascending heap (3mks)
(b) What is an array? Explain how to declare and initialize one-dimensional array in
C language. (5mks)
(c) Explain underflow in stack and how to test this condition in C language (3mks)
(d) What is the use of pointers? Explain dynamic memory management (3mks)
(e) Write an algorithm for searching in a binary tree (6mks)
QUESTION THREE (20 MARKS)
(a) Explain with the aid of a diagram circular linked list and doubly linked list
(4mks)
(b) What is a binary tree? Explain depth first order in binary tree (5mks)
(c) Explain the tower of Hanoi problem (5mks)
(d) Write a program in C to assign and display any elements in a 3x3 array (6mks)
QUESTION FOUR (20 MARKS)
(a) Give three application of a graph. (3mks)
(b) Define ADT with examples. (2mks)
(c) Explain how you can implement a stack using linked list (2mks)
(d) Explain insertion in binary search tree (3mks)
(e) Explain overflow situation in stack (3mks)
(f) What is recursion? List any three examples of mathematical functions that can be
defined recursively (5mks)
(g) List the names of the ends where enqueing and dequeing in queues are done
(2mks)
More Question Papers