Skip to content
Gblog GEEK-O-LYMPICS 2022 – May The Geeks Force Be With You!
Is it possible to have tons of fun while maintaining your competitive spirit? Totally! It is 100% possible. For the geeks who code hard and… Read More
We know the Pascal’s Identity very well, i.e. ncr = n-1cr + n-1cr-1 A curious reader might have observed that Pascal’s Identity is instrumental in… Read More
Given a Binary Tree, write an iterative function to print the Preorder traversal of the given binary tree.Refer to this for recursive preorder traversal of… Read More
We can print 1 to 100 without using loops and recursion using three approaches discussed below: 1) Template Metaprogramming: Templates in C++ allow non-datatypes also… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> using namespace std;    template <int N> class A {    int arr[N]; public:    virtual… Read More
Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the… Read More
I am Amit Dhaka. Following is my experience of MS IDC intern interview. Date of Written: 9th September, 2012. Date of Interview: 15 October, 2012.… Read More
Reservoir sampling is a family of randomized algorithms for randomly choosing k samples from a list of n items, where n is either a very… Read More
Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More
Given a binary tree and a key(node) value, find the floor and ceil value for that particular key value. Floor Value Node: Node with the… Read More
Given a string, find the longest substring which is a palindrome.  Examples:  Input: Given string :"forgeeksskeegfor", Output: "geeksskeeg". Input: Given string :"Geeks", Output: "ee". Recommended… Read More
Given an M x N matrix, transpose the matrix without auxiliary memory.It is easy to transpose matrix using an auxiliary array. If the matrix is… Read More
Write a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). Example:   Input: n = 4 and k… Read More
Given a string, move all even positioned elements to the end of the string. While moving elements, keep the relative order of all even positioned… Read More
We have discussed assignment operator overloading for dynamically allocated resources here. In this article, we discussed that when we don’t write our own assignment operator,… Read More
Given a string, find the longest substring which is palindrome.  For example,  Input: Given string :"forgeeksskeegfor", Output: "geeksskeeg" Input: Given string :"Geeks", Output: "ee" Recommended… Read More

Start Your Coding Journey Now!