Rajeev's posts

Post has attachment

Public

**Count the number of possible triangles**

Post has attachment

Public

**Excel Sheet Row Numbers**

Given the sequence S1 = {a,b,c,d,…,x,y,z,aa,ab,ac…. } and given that this sequence corresponds (term for term) to the sequence S2 = {0,1,2,3,….}. Write code to convert an element of S2 to the corresponding element of S1 . Equation (1) n = 26 + 26 2 +...

Post has attachment

Public

**

Counting Boolean Parenthesizations: You are given a boolean expression consisting of a string of the symbols 'true', 'false', 'and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, th...

Counting Boolean Parenthesizations: You are given a boolean expression consisting of a string of the symbols 'true', 'false', 'and', 'or', and 'xor'. Count the number of ways to parenthesize the expression such that it will evaluate to true. For example, th...

Post has attachment

Public

**Balanced Partition**

Balanced Partition: You have a set of n integers each in the range 0 ... K. Partition these integers into two subsets such that you minimize |S1 - S2|, where S1 and S2 denote the sums of the elements in each of the two subsets.

Post has attachment

Public

**Knapsack problem**

Integer Knapsack Problem (Duplicate Items Forbidden): This is the same problem as the example above, except here it is forbidden to use more than one instance of each type of item.

Post has attachment

Public

**Building Bridges**

Building Bridges : Consider a 2-D map with a horizontal river passing through its center. There are n cities on the southern bank with x-coordinates a(1) ... a(n) and n cities on the northern bank with x-coordinates b(1) ... b(n). You want to connect as man...

Post has attachment

Public

Post has attachment

Post has attachment

Public

Wait while more posts are being loaded