Posts from C++

Closest leaf node to a given node in Binary Tree in C++

By Saksham Agarwal

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

How to speed up Program execution using Pragma in C++

By Shristi Singh

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

C++ program to check if leaf traversal of two Binary Trees is same

By Himanshu Baranwal

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

C++: Minimum time to burn a Tree starting from a Leaf node

By Himanshu Baranwal

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

Frobenius Norm of a given matrix in C++

By Ranjeet V

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

How to set bits in all numbers from 1 to n in C++

By Adit Gupta

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

typeid operator in C++ with examples

By Siddhant Chouhan

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

C++ program to demonstrate sort() with any compare function

By Sumanth

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

Related Posts