Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Graph MST Graph

Total number of Spanning Trees in a Graph

If a graph is a complete graph with n vertices, then total number of spanning trees is n(n-2) where n is the number of nodes in the graph. In complete graph, the task...
Graph Greedy Kruskal

Kruskal’s Minimum Spanning Tree Algorithm Greedy Algo-2

What is Minimum Spanning Tree? Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices togeth...
Graph MST Graph

Minimum Product Spanning Tree

Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together. A single graph can have man...
Graph Greedy MST

Reverse Delete Algorithm for Minimum Spanning Tree

Reverse Delete algorithm is closely related to Kruskal’s algorithm. In Kruskal’s algorithm what we do is : Sort edges by increasing order of their weigh...
Graph Tree BFS

Check if a given graph is tree or not

Write a function that returns true if a given undirected graph is tree and false otherwise. For example, the following graph is a tree. But the following graph is n...
Graph MST STL

Kruskal’s Minimum Spanning Tree using STL in C++

Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Kruskal’s algorithm. Input : Graph as an array of ed...
Graph Graph

Check whether given degrees of vertices represent a Graph or Tree

Given the number of vertices and the degree of each vertex where vertex numbers are 1, 2, 3,…n. The task is to identify whether it is a graph or a tree. It ma...
Hash Tree Amazon

Print a Binary Tree in Vertical Order Set 2 (Map based Method)

Given a binary tree, print it vertically. The following example illustrates vertical order traversal. 1 / 2 3 / / ...
Hash Tree Amazon

Vertical Sum in a given Binary Tree Set 1

Given a Binary Tree, find the vertical sum of the nodes that are in the same vertical line. Print all sums through different vertical lines. Examples: 1 / ...
Hash Tree Amazon

Clone a Binary Tree with Random Pointers

Given a Binary Tree where every node has following structure. struct node { int key; struct node *left,*right,*random; } The random pointer points to any ...

Subscribe to Our Newsletter