Skip to content
All Medium Articles
Introduction: A red-black tree is a kind of self-balancing binary search tree where each node has an extra bit, and that bit is often interpreted… Read More
#include <stdio.h> #include <stdlib.h>    int main(void) {     int i;     int *ptr = (int *) malloc(5 * sizeof(int));        for (i=0; i<5; i++)         *(ptr +… Read More
  We have discussed BST search and insert operations. In this post, the delete operation is discussed. When we delete a node, three possibilities arise. 1)… Read More
/* C Program to count the Number of Lines in a Text File  */ #include <stdio.h> #define MAX_FILE_NAME 100    int main() {     FILE *fp;… Read More
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
Which of the following are decidable? I. Whether the intersection of two regular languages is infinite II. Whether a given context-free language is regular III.… Read More
We basically ignore half of the elements just after one comparison.   Compare x with the middle element. If x matches with the middle element, we… Read More
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 suffix array… Read More
Assume that the size of char is 1 byte and negatives are stored in 2’s complement form #include<stdio.h> int main() {     char c = 125;… Read More
#include <stdio.h> void f(char**); int main() {     char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" };     f(argv);     return 0; } void f(char **p)… Read More
Consider the data of previous question. Suppose that the sliding window protocol is used with the sender window size of 2^i where is the number… Read More
Consider the following relational schema: Suppliers(sid:integer, sname:string, city:string, street:string) Parts(pid:integer, pname:string, color:string) Catalog(sid:integer, pid:integer, cost:real) Assume that, in the suppliers relation above, each supplier and… Read More
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
Assume that the size of int is 4. #include <stdio.h> void f(char**); int main() {     char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl"… Read More
#include<stdio.h> int main() {     int a[10][20][30] = {0};     a[5][2][1] = 2;     return 0; } Which of the following will print the value 2 for the… Read More
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
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
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
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
Output of following Java program? import java.util.Arrays; class Test {     public static void main (String[] args)      {         int arr1[] = {1, 2, 3};         int arr2[]… Read More