Skip to content

Category Archives: C++

Given a 2-D array of order N x N, print a matrix that is the mirror of the given tree across the diagonal. We need… Read More
Given a matrix of 2D array of n rows and m columns. Print this matrix in ZIG-ZAG fashion as shown in figure.   Example:   Input: 1… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples: Input: 1->2->3->4->5->6->7->8->NULL and k =… Read More
Given a positive integer N, the task is to find the maximum value among all the rotations of the digits of the integer N. Examples:… Read More
What is a tuple? A tuple in C++ is an object which is used to group elements together. In a tuple, elements can be of… Read More
What is a tuple? A tuple in C++ is an object that has the ability to group a number of elements. The elements can be… Read More
Object Compositions An object is a basic unit of Object-Oriented Programming and represents real-life entities. Complex objects are objects that are built from smaller or… Read More
What is pair? Utility header in C++ provides us pair container. A pair consists of two data elements or objects.  The first element is referenced… Read More
What is Forward List? Forward list in STL is used to implement a singly linked list. It was introduced from C++11 onwards, forward lists are… Read More
What is Multiset? A multiset is an associative container that can hold a number of elements in a specific order. Unlike a set, a multiset… Read More
What is Multiset? A multiset in C++ is an associative container that can hold a number of elements in a specific order. Unlike a set,… Read More
What is an unordered set? In C++, an unordered set is an unordered container that can hold a number of unique elements. Unlike a set,… Read More
What is Vector? In C++, a vector is similar to dynamic arrays with the ability to resize itself automatically. Vector elements are stored in contiguous… Read More
Given an array of n numbers. The problem is to move all the 0’s to the end of the array while maintaining the order of… Read More
Given a string, we need to find the minimum number of rotations required to get the same string. Examples: Input : s = "geeks" Output… Read More