CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
3
You visited us 3 times! Enjoying our articles? Unlock Full Access!
Question

An undirected graph G with n vertices and edges is represented by adjacency list. What is the time required to generate all the connected components?

A
0 (n)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
0 (e)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
0 (e+n)
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
0 (e2)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C 0 (e+n)

An undirected graph G with n vertices and edges is represented by adjacency list. 0 (e+n) is the time required to generate all the connected components.


An undirected graph is graph, that is a set of objects (called vertices or nodes) that are connected together, where all the edges are bidirectional. An undirected graph is sometimes called an undirected network. In contrast, a graph where the edges point in a direction is called a directed graph.


A simple graph is an undirected graph without multiple edges or loops. In a simple graph the edges form a set (rather than a multi set) and each edge is an unordered pair of distinct vertices.



930624_918304_ans_423e545c828f4070b42188cbc5b2c437.png

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Speed and Velocity
PHYSICS
Watch in App
Join BYJU'S Learning Program
CrossIcon