0% found this document useful (0 votes)
10 views

50 BSDS Objective Data Structure

The document provides information about a terminal exam for a data science course. It includes multiple choice and short answer questions about data structures and algorithms topics like shell sort, adjacency lists/matrices, BFS, and graph traversals.

Uploaded by

kamran ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

50 BSDS Objective Data Structure

The document provides information about a terminal exam for a data science course. It includes multiple choice and short answer questions about data structures and algorithms topics like shell sort, adjacency lists/matrices, BFS, and graph traversals.

Uploaded by

kamran ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

UNIVERSITY OF HARIPUR

DEPARTMENT OF INFORMATION TECHNOLOGY

TERMINAL EXAMINATION FALL 2023

Class: BS (Data Science) 3rd Date: Thursday, 31st January 2024


Subject: Data Structure & Algorithm Instructor: Mr. Kamran Ahmad Awan
Total Time Allowed: 30 Minutes Max Marks: 20 Marks

Name: ___________________________ Roll #: ___________________________

SECTION-A

Q No. 1 (A). Match items from Column A with the correct items in Column B. For example: If S. No 1
of Column A matches with S. No A of Column B then you need to write as 1, A in the table below.
S. No Column A S. No. Column b
A data structure used for storing graph relationships efficiently for
1. Shell Sort A.
sparse graphs.
Involves sorting elements at a specific interval and gradually
2. BFS B.
reducing the interval.
A way of representing graph connections where each vertex points
3. Adjacency List C.
to a list of its neighbors.
Utilizes this structure to keep track of the vertices to be explored
4. Adjacency Matrix D.
next.
5. Gap sequence E. A method of representing graph relationships in a 2D array format.
An algorithm for traversing or searching tree or graph data
6. Queue usage F.
structures, layer by layer.

Write the correct match below:

Q No. 1 (B). Arrange the following steps of the Shell Sort algorithm in the correct order:

a) Reduce the gap and repeat the process. c) Sort the elements at each gap.
b) Start with a large gap, then reduce the gap. d) Finish when the gap is 1.
Q No. 1 (C). In a city road network represented as a graph, each intersection is a vertex and each road is
an edge. You need to find the shortest path from the City Hall to all other intersections. Which algorithm
would be more efficient and why?

Q No. 1 (D). Given the following adjacency matrix representation of a graph, identify whether it represents
a directed or undirected graph. Justify your answer based on the matrix.

A B C
A 0 1 0
B 1 0 1
C 0 1 0

Answer with Justification:

Q No. 1 (E). Given the sequence of nodes visited in a graph traversal: A, C, E, B, D. Identify whether this
sequence most likely represents a traversal done by Shell Sort, BFS, or neither. Justify your choice based
on the characteristics of the given algorithms. Answer Options are as below:

a) Shell Sort b) BFS c) Neither

Correct Option: ___________________________

Justification.

*************************************************************

You might also like