Hello all, today we will write a program to check if given Binary Tree is Binary Search Tree or not. So let’s start with what properties a tree must satisfy so that it is a Binary Search Tree. The tree satisfies the binary search tree property, which states that the key in each node […]

## C++ program to implement AVL Tree

An AVL tree is another balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Addition and deletion operations also […]

## C++ Program to Implement Floyd Warshall Algorithm

Floyd–Warshall algorithm is an algorithm for finding shortest paths in a weighted graph with positive or negative edge weights (but with no negative cycles). A single execution of the algorithm will find the lengths (summed weights) of the shortest paths between all pairs of vertices, though it does not return details of the paths themselves. […]

## Program to implement Binary Search Tree C++

A Binary Search Tree is a Binary Tree data structure ( a tree in which each node has at most two children ) which has the following properties: The left subtree of a node contains only nodes with keys less than the node’s key. The right subtree of a node contains only nodes with keys […]

## Program to implement Depth First Search C++

What is Depth First Search? Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores as far as possible along each branch before backtracking. A version of depth-first search was […]

## Minimum Spanning Tree using Prim’s Algorithm

What is Spanning Tree? The idea behind minimum spanning trees is simple: given a graph with weighted edges, find a tree of edges with the minimum total weight. What is a spanning tree? A graph that satisfies these three properties: connected, acyclic, and consisting of |V| – 1 edges. (In fact, any two of the three […]