---
title: "Discussion on \"Perform BFS, DFS for both connected & disconnected Graphs\" | Hashnode"
description: "Discussion on \"Perform BFS, DFS for both connected & disconnected Graphs\". import java.util.*;\nclass Graph{\n    private final int V;\n    private final List<List<Integer>> adjList;\n\n    public Graph(int Vtcs)\n    {\n        this.V = Vtcs;\n        adjList = new ArrayList<>(V); //[]\n        for(int i=0 ; i<V ; i++)\n        {\n  ..."
url: "https://hashnode.com/posts/perform-bfs-dfs-for-both-connected-disconnected-graphs/684bbe9b9308cb9b0a1d873d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Perform BFS, DFS for both connected & disconnected Graphs](https://polkamnidhiblog.hashnode.com/perform-bfs-dfs-for-both-connected-disconnected-graphs?utm_source=hashnode&utm_medium=feed)

import java.util.\*; class Graph{ private final int V; private final List<List<Integer>> adjList; public Graph(int Vtcs) { this.V = Vtcs; adjList = new ArrayList<>(V); //\[\] for(int i=0 ; i<V ; i++) { ...

Jun 13, 2025 · 3 min read · polkamnidhiblog.hashnode.com  
Read the article

## Written by

[Polkam Srinidhi](https://hashnode.com/@srinidhi625)

@srinidhi625 · Hyderabad, India

  
[View profile](https://hashnode.com/@srinidhi625)

Undergraduate

I am a final year student graduates on May 2024, started my journey into practical approach of learning Tech Stacks with open source contribution and Projects.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
