0% found this document useful (0 votes)
3 views2 pages

Hcsci136 Dec 2022

Past exam question papers very helpful for Computer science students

Uploaded by

believezhou200
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Hcsci136 Dec 2022

Past exam question papers very helpful for Computer science students

Uploaded by

believezhou200
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
MIDLANDS STATE UNIVERSITY FACULTY OF SCIENCE AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE DATA STRUCTURES AND ALGORITHMS CODE: HCSCI 136 SESSIONAL EXAMINATIONS NOVEMBER 2022 DURATION: 3 Hours INSTRUCTIONS 1. Answer All questions in Section A and any 2 questions from Section B 2. Section A carries 50 Marks 3. Each question in Section B carries 25 Marks 4. You are advised 19 comment your code 5. All program codes tobe written in Python, SECTION A [50 MARKS]: ANSWER ALL QUESTIONS IN THIS SECTION QUESTION ONE 8) Define the following terms using suitable examples: i. Circular Linked List eB i Linear Data Structure pI Time complexity a iv, Stack, Pi ¥. Space complenity a Priority queue pl i. Directed Acyelic Graph pl viii. Abstract Data Structure BI ) Outline the charcteisis of en algorithm. is) QUESTION TWO 8) Compare max heap and min heap using examples i ') Deseribe the asymptotic notations applied in algorithm analysis. (61 ©) Write a program that demonstrates any five basic array operations, make sur you ‘comment your code and give the expected output. 15] SECTION B [50 MARKS]: ANSWER ANY 2 QUESTIONS IN THIS SECTION, (QUESTION THREE, 1) Describe the properties of@ binary tre. in ) Make a binary search tree (BST) for the following sequence of numbers: 13, 83, 4, 12, 14, 10, 68, 97, 39, I, 76,18, 15 pl ©) Apply pre-order, in-order and post-order traversalson the BST in.) above. [6] 44) Demonstrate the heapify operation using a suitable example (6 QUESTION FOUR 1) Demonstrate the merge sort algorithm using a suitable example. rm ») Distinguish depth-first search and breath-frst search as applied in graphs. [8] ©) Mention operations applicable to priority queues and their respective running, times for sorted list implementations. 10), QUESTION FIVE 1) Explain the three ways of implementing stacks in python. 0 Write a program that: i. Prompts # user to enter the elements of a stack li, Add the elements to the stack, show the elements in the stick, remove the clement ifthe sack is not empty and print the removed clement. [18] END OF EXAM. Page 2 of2

You might also like