You are on page 1of 1

COMSATS University Islamabad, Vehari Campus

Department of Computer Science


FINAL EXAMINATION – SPRING 2020
Class: BSCS Batch-18 Date: Saturday 06-06-2020
Subject: Algorithms & Data Structures Instructor: Zaheer Akhtar
Total Time Allowed: 90 Minutes Max Marks: 50

READ THE INSRTUCTIONS CAREFULLY

Answer the questions on white pages of A4 size. Only hand written solution will be acceptable. Every
page must contain Name, Registration, Section and page number. Upload/Email the solution within the
given time. Keep your cameras on during the exam.

Question No. 1: Consider the following tree: [Marks: 10]

(Part-a) How many leaves does it have?


(Part-b) How many of the nodes have at least one sibling?
(Part-c) What is the value stored in the parent node of the node containing 30?
(Part-d) How many descendants does the root have?
(Part-e) What is the depth of the tree?

Question No. 2: [Marks: 10 + 10]

(Part-a) Show the various passes of bubble sort on an unsorted list: 23, 17, 8, 11, 15, 2, 13, and 6.

(Part-b) Write the output for the given binary tree when traversing in
preorder, inorder and Postorder form.

Question No. 5: [Marks: 10 + 10]

(Part-a) Write the steps to delete a particular node from binary search tree.
Trace your algorithm to delete a node (10) from the given tree.

(Part-b) Make a BST for the following sequence of numbers. 45 32 90 34 68 72 15 24 30 66 11 50 10

1|Page

You might also like