## Check if a given matrix is sparse or not

A matrix is a two dimensional data objects having m rows and n columns, therefore a total of m*n values. If most of the values… Read More »

## Aptitude | GATE CS 1998 | Question 70

Answer the following: a.  Let G1 = (N, T, P, S1) be a CFG where, N= {S1A, B}, T= {a,b} and P is given by… Read More »

## Find the last digit when factorial of A divides factorial of B

We are given two numbers A and B such that B >= A. We need to compute the last digit of this resulting F such… Read More »

## Count of substrings of a binary string containing K ones

Given a binary string of length N and an integer K, we need to find out how many substrings of this string are exist which… Read More »

## Cyclic Number

A cyclic number is an integer in which cyclic permutations of the digits are successive multiples of the number. The most widely known is the… Read More »

## Sum of all subsets of a set formed by first n natural numbers

Given a number n, we need to find the sum of all the elements from all possible subsets of a set formed by first n… Read More »

## Microsoft Interview Experience | Set 139 (For Internship)

Around 100 applied for the first round of Microsoft Internship offer. Basic Criteria was to have a CGPA of greater than 7.00. Round 1: Three… Read More »

## Minimum element whose n-th power is greater than product of an array of size n

Given an array of n integers. Find minimum x which is to be assigned to every array element such that product of all elements of… Read More »

## Find maximum sum of triplets in an array such than i < j < k and a[i] < a[j] < a[k]

Given an array of positive integers of size n. Find the maximum sum of triplet( ai + aj + ak ) such that 0 <=… Read More »

## Maximum prefix-sum for a given range

Given an array of n integers and q queries, each query having a range from l to r. Find the maximum prefix-sum for the range… Read More »

## Aptitude | GATE CS 1998 | Question 69

Let M = ({q0, q1}, {0, 1}, {z0, x}, δ, q0, z0, ∅) be a pushdown automaton where δ is given by δ(q0, 1, z0) = {(q0, xz0)}… Read More »

## Generate two output strings depending upon occurrence of character in input string.

Given an input string str[], generate two output strings. One of which consists of those character which occurs only once in input string and second… Read More »

## PHP | Data Types

Data Types defines the type of data a variable can store. PHP allows eight different types of data types. All of them are discussed below.… Read More »

## Aptitude | GATE CS 1998 | Question 68

Let (A, *) be a semi group. Furthermore, for every a and b in A, if a ≠ b, then a*b ≠ b*a. a. Show that for… Read More »

## Aptitude | GATE CS 1998 | Question 67

Suppose A={ a, b, c, d } and Π1 is the following partition of A Π1= { {a, b, c} {d} } a. List the… Read More »