Leaderboard
Showing:
Handle Score
@Ibrahim Nash 6424
@blackshadows 6380
@mb1973 5704
@Quandray 5245
@akhayrutdinov 5111
@saiujwal13083 5046
@sanjay05 3762
@kirtidee18 3673
@mantu_singh 3532
@marius_valentin_dragoi 3523
@sushant_a 3459
Complete Leaderboard
Biconnected Graph
Medium Accuracy: 43.93% Submissions: 189 Points: 4

Given a graph with n vertices, e edges and an array arr[] denoting the edges connected to each other, check whether it is Biconnected or not.
Note: The given graph is Undirected.

 

Example 1:

Input:
n = 2, e = 1
arr = {0, 1}
Output:
1
Explanation:
       0
      /
     1
The above graph is Biconnected.

Example 2:

Input:
n = 3, e = 2
arr = {0, 1, 1, 2}
Output:
0
Explanation:
       0
      /
     1
      \
       2
The above graph is not Biconnected.

 

Your Task:
You don't need to read input or print anything. Your task is to complete the function biGraph() which takes 2 Integers n, and e and an array arr of length 2*e as input and returns 1 if the graph is biconnected else returns 0.

 

Expected Time Complexity: O(n+e)
Expected Auxiliary Space: O(n)

 

Constraints:
1 <= e <= 100
2 <= n <= 100

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Biconnected Graph

Output Window