All Medium Articles

Red-Black Tree | Set 2 (Insert) 3.3

In the previous post, we discussed introduction to Red-Black Trees. In this post, insertion is discussed. In AVL tree insertion, we used rotation as a… Read More »

GATE | GATE CS 2008 | Question 46 3.6

You are given the postorder traversal, P, of a binary search tree on the n elements 1, 2, …, n. You have to determine the… Read More »

Amazon Interview | Set 63 (For SDE-1) 3

I have a total experience of two years. I am sharing my interview experience with Amazon. This is for SDE1 Amazon. A very big thanks… Read More »

Amazon Interview | Set 61 (For Internship) 3.3

Hello geeks, Last month I appeared for the Internship Interview of Amazon. What my personal experience says is that never try to jump to the… Read More »

Red-Black Tree | Set 1 (Introduction) 3.3

Red-Black Tree is a self-balancing Binary Search Tree (BST) where every node follows following rules. 1) Every node has a color either red or black.… Read More »

C | Advanced Pointer | Question 9 3

filter_none edit close play_arrow link brightness_4 code #include <stdio.h> #include <stdlib.h>    int main(void) {     int i;     int *ptr = (int *) malloc(5 * sizeof(int));… Read More »

Binary Search Tree | Set 2 (Delete) 3

We have discussed BST search and insert operations. In this post, delete operation is discussed. When we delete a node, three possibilities arise. 1) Node… Read More »

C Program to count number of lines in a file 3.2

filter_none edit close play_arrow link brightness_4 code /* C Program to count the Number of Lines in a Text File  */ #include <stdio.h> #define MAX_FILE_NAME… Read More »

GATE | GATE CS 2008 | Question 23 3

Which of the following statements is true for every planar graph on n vertices? (A) The graph is connected (B) The graph is Eulerian (C)… Read More »

Java Program for Binary Search (Recursive and Iterative) 3

We basically ignore half of the elements just after one comparison. Compare x with the middle element. If x matches with middle element, we return… Read More »

Suffix Array | Set 1 (Introduction) 3

We strongly recommend to read following post on suffix trees as a pre-requisite for this post. Pattern Searching | Set 8 (Suffix Tree Introduction) A… Read More »

C | Data Types | Question 7 3.8

Assume that the size of char is 1 byte and negatives are stored in 2’s complement form filter_none edit close play_arrow link brightness_4 code #include<stdio.h>… Read More »

C | Pointer Basics | Question 17 3.5

filter_none edit close play_arrow link brightness_4 code #include <stdio.h> void f(char**); int main() {     char *argv[] = { “ab”, “cd”, “ef”, “gh”, “ij”, “kl” };… Read More »

GATE | GATE-CS-2009 | Question 57 3

Frames of 1000 bits are sent over a 10^6 bps duplex link between two hosts. The propagation time is 25ms. Frames are to be transmitted… Read More »

GATE | GATE-CS-2009 | Question 54 3

Consider the data given in the previous question. The values of l(i, j) could be obtained by dynamic programming based on the correct recursive definition… Read More »

GATE | GATE-CS-2009 | Question 60 3

Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2 units). A non-preemptive resource allocation policy… Read More »

C | Advanced Pointer | Question 7 3

Assume that the size of int is 4. filter_none edit close play_arrow link brightness_4 code #include <stdio.h> void f(char**); int main() {     char *argv[] =… Read More »

GATE | GATE-CS-2009 | Question 24 3

The binary operation c is defined as follows P Q PcQ T T T T F T F T F F F T Which one… Read More »

GATE | GATE-CS-2009 | Question 60 3

For the composition table of a cyclic group shown below * a b c d a a b c d b b a d c… Read More »

GATE | GATE-CS-2009 | Question 11 3

S -> aSa|bSb|a|b; The language generated by the above grammar over the alphabet {a,b} is the set of (A) All palindromes (B) All odd length… Read More »