Posts by Abhishek Sharma

Author Biographical Info: Not available

C++ program to Rotate bits

By Abhishek Sharma

Hey there! In this tutorial, we will learn how to rotate bits of a number using the C++ programming language. Here is what rotation means: Suppose there is a number 13 and we want .... Read More

Check if two nodes are cousins in a Binary Tree in C++

By Abhishek Sharma

In this C++ programming tutorial, we will see how to check if two nodes are cousins in a binary tree. Firstly two nodes are cousins when they are at the same depth but they have di.... Read More

Convert a map to a vector in C++

By Abhishek Sharma

This is a tutorial on how to convert a map to a vector in C++. Maps are used to store key-value pairs in an ordered way. And so, to store these we need a vector of paired values. S.... Read More

How to clear/empty priority_queue of objects in C++

By Abhishek Sharma

In this tutorial, I will show you how you can clear/empty priority_queue of objects in C++. Since there is no inbuilt function in priority_queue to clear/empty it, thus we will see.... Read More

Rearrange array such that elements at even positions are greater than odd in C++

By Abhishek Sharma

Hello there! In this tutorial, we will rearrange elements of an array such that elements at even positions are greater than odd positions. e.g. int arr[]={15,12,13,18,5,9}; // for .... Read More