All Medium Articles

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 »

Python Program for Binary Search (Recursive and Iterative) 3

In a nutshell, this search algorithm takes advantage of a collection of elements that is already sorted by ignoring half of the elements after just… 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 »

GATE | GATE-CS-2009 | Question 6 3

What is the minimum number of gates required to implement the Boolean function (AB+C)if we have to use only 2-input NOR gates? (A) 2 (B)… Read More »

GATE | GATE-CS-2009 | Question 2 3

What is the chromatic number of an n-vertex simple connected graph which does not contain any odd length cycle? Assume n >= 2. (A) 2… Read More »

Java | Exception Handling | Question 1 3

Predict the output of following Java program filter_none edit close play_arrow link brightness_4 code class Main {    public static void main(String args[]) {       try {… Read More »

Java | Arrays | Question 7 3

Output of following Java program? filter_none edit close play_arrow link brightness_4 code import java.util.Arrays; class Test {     public static void main (String[] args)      {         int… Read More »

C | Macro & Preprocessor | Question 13 3.2

Output of following C program? filter_none edit close play_arrow link brightness_4 code #include<stdio.h> #define max abc #define abc 100    int main() {     printf(“maximum is… Read More »

Splay Tree | Set 2 (Insert) 3.5

It is recommended to refer following post as prerequisite of this post. Splay Tree | Set 1 (Search) As discussed in the previous post, Splay… Read More »

Splay Tree | Set 1 (Search) 3.2

The worst case time complexity of Binary Search Tree (BST) operations like search, delete, insert is O(n). The worst case occurs when the tree is… Read More »

Java | Constructors | Question 3 3

Which of the following is/are true about constructors in Java? 1) Constructor name should be same as class name. 2) If you don’t define a… Read More »