wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following statements given below:

S1: Consider a unweighted undirected connected graph G[V, E] worst case time complexity to check it two particular vertices U, V present in the graph is O (V + E). Check it two particular vertices U, V present in the graph is O (V + E).

S2: Dijkstra's algorithm may produce incorrect result if it contain negative weight cycle.

S3: The worst case running time complexity to search for an element in a balanced binary search tree with n element is O(n).

Which of the above statement is correct?

A
Only S1 and S2
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
Only S2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Only S2 and S3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Only S1 and S3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A Only S1 and S2
(d)

S1 For checking two particular vertices present in graph or not. BFS can be used it take O(V+E).

S1 is correct

S2 Negative weight cycle contain cycle whose weight is negative. Dijkstra's algorithm may produce incorrect result if it contain negative weight cycle.

S2 is correct

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Line Graphs and Linear Graphs
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon