Time complexity to find if there is an edge between 2 particular vertices is _________

Category: QuestionsTime complexity to find if there is an edge between 2 particular vertices is _________
Editor">Editor Staff asked 1 month ago

Time complexity to find if there is an edge between 2 particular vertices is _________
 
(a) O(V)
 
(b) O(E)
 
(c) O(1)
 
(d) O(V+E)
 
My question is taken from Adjacency List in portion Graph of Data Structures & Algorithms I
 
The question was asked in exam.

1 Answers
Editor">Editor Staff answered 1 month ago

Correct option is (a) O(V)
 
For explanation: The maximum edges a vertex can have is V-1.