## C++ Program to Solve any Linear Equation in One Variable

This is a C++ Program that Solves any Linear Equation in One Variable. Problem Description The Problem states that given a linear equation in one variable of the form aX + b = cX + d where a,b,c,d are provided as input, we need to determine the appropriate value of X. Problem Solution Solving the … Read more

## C++ Program to Check if an Directed Graph is a Tree or Not Using DFS

This is a C++ Program to check whether an directed graph is tree or not. Graph is tree if it doesn’t contain cycles. Here is source code of the C++ Program to Check if an Directed Graph is a Tree or Not Using DFS. The C++ program is successfully compiled and run on a Linux … Read more

## C++ Program to Find the Edge Connectivity of a Graph

This is a C++ Program to find edge connectivity of a graph. An edge in an undirected connected graph is a bridge if removing it disconnects the graph. For a disconnected undirected graph, definition is similar, a bridge is an edge removing which increases number of connected components. Here is source code of the C++ … Read more

## C++ Program to Implement Dijkstra’s Algorithm Using Set

This is a C++ Program to find shortest path. Dijkstra’s algorithm is very similar to Prim’s algorithm for minimum spanning tree. Like Prim’s MST, we generate a SPT (shortest path tree) with given source as root. We maintain two sets, one set contains vertices included in shortest path tree, other set includes vertices not yet … Read more

## C++ Program to Perform Dictionary Operations in a Binary Search Tree

This is a C++ Program to perform dictionary operations in binary search tree. In computer science, a binary search tree (BST), sometimes also called an ordered or sorted binary tree, is a node-based binary tree data structure where each node has a comparable key (and an associated value) and satisfies the restriction that the key … Read more

## C++ Program to Check if a Given Binary Tree is an AVL Tree or Not

This is a C++ Program to check if BST is AVL. An AVL tree is a self-balancing binary search tree. It was the first such data structure to be invented. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ … Read more

## C++ Program to Find the Vertex Connectivity of a Graph

This is a C++ Program to find vertex connectivity of a graph. A vertex in an undirected connected graph is an articulation point (or cut vertex) iff removing it (and edges through it) disconnects the graph. Articulation points represent vulnerabilities in a connected network – single points whose failure would split the network into 2 … Read more

## C++ Program to Test Using DFS Whether a Directed Graph is Weakly Connected or Not

This is a C++ Program to check whether a directed graph is weakly connected or not. We can do DFS V times starting from every vertex. If any DFS, doesn’t visit all vertices, then graph is not strongly connected. This algorithm takes O(V*(V+E)) time which can be same as transitive closure for a dense graph.Time … Read more

## C++ Program to Check if an Undirected Graph is a Tree or Not Using DFS

This is a C++ Program to check whether an undirected graph is tree or not. Graph is tree if it doesn’t contain cycles. Here is source code of the C++ Program to Check if an UnDirected Graph is a Tree or Not Using DFS. The C++ program is successfully compiled and run on a Linux … Read more 