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

Comp 123: Data Structures 2009/2010 Academic Year Question Paper

Comp 123: Data Structures 2009/2010 Academic Year 

Course:Bachelor Of Computer Science

Institution: Kabarak University question papers

Exam Year:2010



COURSE TITLE: DATA STRUCTURES
STREAM: Y1S2
DAY: MONDAY
TIME: 2.00 – 4.00 P.M.
DATE: 02/08/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 each.

QUESTION ONE (30 marks)
(a) Explain how you can use linked list in stack representation (3mks)
(b) What is a complete binary tree. (2mks)
(c) Write a program in C to implement factorial of a number recursively (3mks)
(d) What are the operations in stack? Explain any two (2mks)
(e) What is a pointer? Explain indirection (2mks)
(f) Explain best, worst and average analysis of an algorithm (3mks)
(g) What is a tree? Explain with the aid of a diagram father, sons, ancestors, descendants
and brothers in binary tree (5mks)
(h) What is hashing? Explain any three operations in direct hashing (5mks)
(i) What is complexity analysis? Give two forms of complexity analysis with examples.
(5mks)

QUESTION TWO (20 marks)
(a) What are the limitations of linear queue? How can they be rectified? (3mks)
(b) What is a heap? Differentiate with the use of diagrams between descending and
ascending heap (3mks)
(c) What is an array? Explain how to declare and initialize one-dimensional array in C
language. (5mks)
(d) Explain underflow in stack and how to test this condition in C language (3mks)
(e) Write an algorithm for searching in a binary search 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 the steps for Symmetric order traversal.(Use of a
diagram to explain) (5mks)
(c) What is recursion? Give three mathematical functions that uses recursion (5mks)
(d) Write a program in C to assign and display any elements in a 3x3 array (6mks)

QUESTION FOUR (20 marks)
(a) What are the differences between Stack and Queue? (2mks)
(b) Give three applications of a graph. (3mks)
(c) Explain insertion in binary search tree (3mks)
(d) What are the error conditions that could occur in stack implementation? How can
they be rectified? (2mks)
(e) Why is the Tower of Hanoi considered to be recursive? Explain steps of executing it
if h is the number of disks and A, B and C are the rods. (5mks)
(f) What is degree of node in a graph? (2mks)
(g) Explain the steps for post-order traversal. (3mks)






More Question Papers


Popular Exams



Return to Question Papers