In this tutorial, we’ll see how to find the closest leaf to a node in a Binary tree in C++. Some Terminology: Leaf node: A leaf node in a binary tree is a node that has no ch.... Read More
In this tutorial, we will learn about How to speed up Program execution using Pragma in C++. For that, we first need to know all about Pragma. So, Pragma is a pre-processor directi.... Read More
In this tutorial we will learn how to tell if leaf traversal of two binary trees is the same or not. Leaf traversal of a tree means traversing each leaf of the binary tree from the.... Read More
In this tutorial we will learn about how to find minimum time to burn a tree from a given leaf node. Consider the following binary tree as an input: 20 / 10 / \ 4.... Read More
Hello guys, in this tutorial, we will learn how to find Frobenius Norm of a given matrix in C++. To do this, first, we calculate the squares of all elements in a given matrix and t.... Read More
In this tutorial, I will be showing to set bits of all numbers from 1 to n. I will be using C++ to implement my approach. Setting bits of a number basically means to change the bit.... Read More
In this tutorial, you will learn how to use the typeid operator in C++. The typeid operator in C++ is available in the <typeinfo> library. The syntax is : typeid(variable); T.... Read More
Sorting is required in most of the programs in competitive programming, In this tutorial, we will see how to easily use the sort() method which is provided by the C++ Library. Re.... Read More