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

Dsa Question Bank Unit 5

Uploaded by

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

Dsa Question Bank Unit 5

Uploaded by

km1364
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

UNITV

Graph Terminology, Graph Traversal Topological sorting, Minimum spanning tree – Prims
Algorithm Minimum Spanning Tree - Kruskal’s Algorithm, Network flow problem Shortest
Path Algorithm- Introduction,Shortest Path Algorithm: Dijkstra’s Algorithm Hashing: Hash
functions – Introduction, Hashing: Hash functions Hashing: Collision avoidance, Hashing:
Separate chaining Open Addressing, Linear Probing Quadratic probing, Double Hashing
Rehashing, Extensible Hashing
PART-A (Multiple Choice Questions)
Q. Questions Course Competen
No Outcom ce
e BT Level
1 Other name for directed graph is .......... CO5 BT2
a) Direct graph
b) Digraph
c) Dir-graph
d) Digraph
Ans:D

2 Graph G is .............. (V,E) whereV(G) represents set of vertices and CO5 BT2
E(G) represents setoff edges.
a) Leterally connected
b) Widely Connected
c) Ordered set
d) Literally connected
Ans:C
3 The vertex with zero degree........ CO5 BT2
a) Isolated vertex
b) no cycle graph
c) non cycle graph
d) circular graph
Ans:A

4 The vertex with degree one........ CO5 BT2


a) A tree graph
b) Free tree
c) A tree d
d) pendant vertex
Ans:D
5 In a graph if e=[u,v], Then u and v are called ........ CO5 BT2
a) End points of e
b) Adjacent nodes
c) Neighbours
d) All of the above
Ans:D

6 A Graph is a collection of ____ CO5 BT2


a) row and columns
b) Vetices and edges
c) Equations
d) None of these
Ans:B
7 A Graph G is called_____ if all nodes are fully connected CO5 BT2
a) Cyclic graph
b) Complete graph
c) Not a graph
d) Regular graph
Ans:B

8 Topological sorting for Directed Acyclic Graph (DAG) is a ______ CO5 BT2
ordering of vertices
a) Ascending
b) Decending
c) Linear
d) Non Linear
Ans:B
9 Topological Sorting for a graph is not possible if the graph is not a CO5 BT2
_____
a) Directed Acyclic Graph (DAG)
b) Directed Graph
c) Linear
d) Non Linear
Ans:A

10 Which of the following is/are the operations performed by kruskal’s CO5 BT1
algorithm?
i)sort the edges of G in increasing order by length
ii)keep a subgraph S of G initially empty
iii)builds a tree one vertex at a time
a) i, and ii only
b) ii and iii only
c) i and iii only
d) All i, ii and iii
Ans:A
11 .……………… is known as a greedy algorithm, because it chooses CO5 BT2
at each step the cheapest edge to add to subgraph S.
a) Kruskal’s algorithm
b) Prim’s algorithm
c) Dijkstra algorithm
d) Bellman ford algorithm
Ans :A
12 Dijkstra’s Algorithm cannot be applied on ______________ CO5 BT4
a) A Directed and weighted graphs
b) Graphs having negative weight function
c) Unweighted graphs
d) Undirected and unweighted graphs
ANS:B

13 How many priority queue operations are involved in Dijkstra’s CO5 BT1
Algorithm?
a) 1
b) 3
c) 2
d) 4
Ans:b

14 The maximum number of times the decrease key operation CO5 BT4
performed in Dijkstra’s algorithm will be equal to ___________
a) Total number of vertices
b) Total number of edges
c) Number of vertices – 1
d) Number of edges – 1
Ans:b

15 Dijkstra’s Algorithm is the prime example for ___________ CO5 BT2


a) Greedy algorithm
b) Branch and bound
c) Back tracking
d) Dynamic programmin
Ans:b
16 Prim’s algorithm is a ______ CO5 BT2
a) Divide and conquer algorithm
b) Greedy algorithm
c) Dynamic Programming
d) Approximation algorithm
Ans:b

17 Which of the following is false about Prim’s algorithm? CO5 BT1


a) It is a greedy algorithm
b) It constructs MST by selecting edges in increasing order of their
weights
c) It never accepts cycles in the MST
d) It can be implemented using the Fibonacci heap
Ans:b

18 Kruskal’s algorithm is used to ______ CO5 BT2


a) find minimum spanning tree
b) find single source shortest path
c) find all pair shortest path algorithm
d) traverse the graph
Ans:a

19 What is a hash table? CO5 BT1

a) A structure that maps values to keys


b) A structure that maps keys to values
c) A structure used for storage
d) A structure used to implement stack and queue

Ans: b

20 A hash table can store a maximum of 10 records, currently there are CO5,CO6 BT5
records in location 1, 3,4,7,8,9,10. The probability of a new record
going into location 2, with hash functions resolving collisions by
linear probing is

a) 0.1
b) 0.6
c) 0.2
d) 0.5

Answer: b

21 If several elements are competing for the same bucket in the hash CO5 BT2
table, what is it called?
a) Diffusion
b) Replication
c) Collision
d) Duplication
Answer: b

22 What is direct addressing? CO5 BT1


a) Distinct array position for every possible key
b) Fewer array positions than keys
c) Fewer keys than array positions
d) Same array position for all keys

Answer: a

23 What is the search complexity in direct addressing? CO5 BT1

a)O(n)
b)O (logn)
c)O(nlogn)
d)O(1)

Answer: d
24 In simple uniform hashing, what is the search complexity? CO5 BT1

a)O(n)
b)O(logn)
c)O(nlogn)
d)O(1)

Answer: d

25 In simple chaining, what data structure is appropriate? CO5 BT2

a) Singly linked list


b) Doubly linked list
c) Circular linked list
d) Binary trees

Answer: b
PART B (4 Marks)
1 Define Graph? CO5 BT1
2 Write short notes on adjacent nodes. CO5 BT4
3 What is the use of Kruskal’s algorithm and who discovered it? CO5 BT1
4 Compare indegree and out degree of a graph. CO5,CO6 BT4
5 What is an undirected graph? CO5 BT1
6 What is a directed graph? CO5 BT1
7 What is meant by strongly connected in a graph? CO5 BT1
8 Discuss in detail about depth of the tree CO5 BT6
PART C (12 Marks)
1 Explain the various representation of graph with example in detail? CO5 BT2
2 What is topological sort? Write an algorithm to perform topological CO5 BT1
sort?
3 Construct the steps for implementing Dijkstra's algorithm with an CO5 BT3
example.
4 Explain Extendible hashing in detail. CO5 BT2
5 Explain Rehashing in detail CO5 BT2

You might also like