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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

C++ Program to Apply DFS to Perform the Topological Sorting of a Directed Acyclic Graph

This is a C++ Program to perform Topological Sorting. Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG. Here is source … Read more

advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter