0% found this document useful (0 votes)
22 views4 pages

CUIT205 - April 2020 - December 2020 NORMAL

Data Structures and Algorithms Exam

Uploaded by

Mcebisi Ncube
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)
22 views4 pages

CUIT205 - April 2020 - December 2020 NORMAL

Data Structures and Algorithms Exam

Uploaded by

Mcebisi Ncube
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/ 4
CHINHOYI UNIVERSITY OF TECHNOLOGY SCHOOL OF ENGINEERING SCIENCE AND TECHNOLOGY DEPARTMENT OF ICT AND ELECTRONICS COURSE 5 DATA STRUCTURES AND ALGORITHMS CODE CUIT 205 DATE a JANUARY 2020 (SUPP EXAMINATION) DURATION: 4 HOURS INSTRUCTIONS TO CANDIDATES: i. This is an open book practical examination. ii, Answer all questions in section A and any other two in section B. iii, Create a folder and name it after your reg_number and save it on the desktop. iv. All answers to be saved corresponding to their question numbers. Section A: Answer All Questions [50 Marks] 1) Given items in a list as shown below build a min binary heap. [10] 3 [as eps [elal=l] 2) Fibonacci numbers are defined by the recurrence fy = fy: + f,-» for k > 2, with fy = 0 and {= 1, Create an algorithm that print the first ten(10) numbers of the fibonnacci series. [10] 3) Suppose that we have numbers between 1 and 15 in a binary tree and want to search for the number 9. Implement the best traversal algorithm that get the number on the smallest number of movements, the algorithm should print the visited numbers on each movement. [10) 4) The 1D nearest neighbor data structure has the following ADT. © constructor: create an empty data structure, © insert(x): insert the real number x into the data structure. © query(y): return the real number in the data structure that is closest to y (or null if no such number). a) Design a data structure that performs each operation in O(logn) time in the worst- case. 0] b) Demonstrate how to use the methods that you have implemented in (a). [10] 7) Consider the following weighted graph with 10 vertices and 21 edges. Note that the edge weights are distinct integers between 1 and 21 Drawing 2: Weighted Graph (101 jn on Drawing 2. a) Implement the grap! rithm includes in order to find the shortest path between plement the Kruskal's algo (5) b) im vertex A and Vertex I ‘THE END!!!

You might also like