Skip to content
All Medium Articles
Consider the same code as given in above question. What does the function print() do in general? The function print() receives root of a Binary… Read More
Consider the following code snippet in C. The function print() receives root of a Binary Search Tree (BST) and a positive integer k as arguments.… Read More
Write a C program that doesn’t terminate when Ctrl+C is pressed. It prints a message “Cannot be terminated using Ctrl+c” and continues execution. We can… Read More
Which of the following traversals is sufficient to construct BST from given traversals 1) Inorder 2) Preorder 3) Postorder (A) Any one of the given… Read More
Given an unsigned integer, swap all odd bits with even bits. For example, if the given number is 23 (00010111), it should be converted to… Read More
Output? #include <stdio.h> int main() {   register int i = 10;   int *ptr = &i;   printf("%d", *ptr);   return 0; } (A) Prints 10 on all… Read More
Consider the following Binary Search Tree 10 / \ 5 20 / / \ 4 15 30 / 11 If we randomly search one of… Read More
We have discussed Pancake Sorting in the previous post. Following is a problem based on Pancake Sorting. Given an unsorted array, sort the given array. You… Read More
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation… Read More
What is the difference between struct and class in C++? (A) All members of a structure are public and structures don’t have constructors and destructors… Read More
I was interviewed for Microsoft App-Ex Team. I was selected. I am really thankful to GeeksForGeeks site which provides preparation material for technical interviews organised… Read More
In the following program, X represents the Data Type of the variable check. #include <stdio.h> int main() {     X check;     switch (check)     {         // Some… Read More
Consider the following function int unknown(int n) { int i, j, k = 0; for (i = n/2; i
Following questions have been asked in GATE CS 2013 exam. 1) Which of the following statements is/are TRUE for an undirected graph? P: Number of… Read More
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter. MultiDequeue(Q){ m = k while (Q is… Read More
Total 3 rounds. 1st written followed by 2 face to face and every round was ELIMINATION one.  Round 1(Written – 1hr): 3 sections. 20 min… Read More
Output? (GATE CS 2012) #include <stdio.h> int a, b, c = 0; void prtFun (void); int main () {     static int a = 1; /*… Read More
Given a number N, generate bit patterns from 0 to 2^N-1 such that successive patterns differ by one bit.  Examples: Input: N = 2 Output:… Read More
The array representation of a complete binary tree contains the data in sorted order. Which traversal of the tree will produce the data in sorted… Read More
We have discussed iterative inorder and iterative preorder traversals. In this post, iterative postorder traversal is discussed, which is more complex than the other two… Read More

Start Your Coding Journey Now!