Skip to content
Gblog Crack the Coding Interview With GeeksforGeeks Weekly Contest Series
“The difference between ordinary and extraordinary is practice”, quoted by Vladamir Horowitz. What he said was nothing sort of unique as achieving perfection and success… Read More
C++ #include <iostream> using namespace std;   int add(int a, int b) {     // for loop will start from 1 and move till the value… Read More
Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, that, unlike trees,… Read More
Following questions have been asked in GATE 2012 exam. 1. A process executes the code fork (); fork (); fork (); The total number of… Read More
  We have discussed AVL insertion in the previous post. In this post, we will follow a similar approach for deletion. Steps to follow for… Read More
Given a Binary Tree, find the vertical sum of the nodes that are in the same vertical line. Print all sums through different vertical lines.Examples:  … Read More
Following questions have been asked in GATE 2012 exam.  1) The recurrence relation capturing the optimal time of the Tower of Hanoi problem with n… Read More
Following questions have been asked in GATE 2012 exam.1. What will be the output of the following C program segment?   C char inchar = 'A';… Read More
AVL Tree: AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than… Read More
Following questions have been asked in GATE 2012 exam.  1) Let w(n) and A(n) denote respectively, the worst case and average case running time of… Read More
Predict the output of following C programs. Question 1 #include <stdio.h>     int main() {   int arr[] = {};   printf("%d", sizeof(arr));   return 0; } Output:… Read More
In the previous post, we discussed how Asymptotic analysis overcomes the problems of the naive way of analyzing algorithms. But let’s take an overview of… Read More
Largest BST in a Binary Tree | Set 3 Method 3 (Shorter, Smarter and More Efficient)  In this section, a different O(n) solution is discussed.… Read More
Most of the times declarations are simple to read, but it is hard to read some declarations which involve pointer to functions. For example, consider… Read More
Given a Binary Tree where each node has positive and negative values. Convert this to a tree where each node contains the sum of the… Read More
The following are the common definitions of Binomial Coefficients.  A binomial coefficient C(n, k) can be defined as the coefficient of x^k in the expansion… Read More

Start Your Coding Journey Now!