Category: Puzzles

Travelling Salesman Problem using Branch and Bound

Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route that visits every city exactly once and returns to the starting point.

Read More Travelling Salesman Problem using Branch and Bound

Magnet Puzzle

We are given set of bipolar magnets each domino-shaped. The objective is to place magnets on a M X N board which should meet a set of conditions where both N and M are not odd.

Determine the if condition to print specific output

What should be the if condition in below code snippet, so that output would be “Hello World”. if “condition”     printf (“Hello”); else     printf(“World”);

Read More Determine the if condition to print specific output

Find numbers represented as sum of two cubes for two different pairs

Given a large number N, find all positive numbers less than N that can be represented as sum of two cubes for at-least two different pairs.   In other words, find all positive numbers M less than given number N that can be expressed as M = (a^3 + b^3) = (c^3 + d^3) for …

Read More Find numbers represented as sum of two cubes for two different pairs

Tower of Hanoi Problem

The Tower of Hanoi is a mathematical puzzle consisting of three rods and n disks of different sizes which can slide onto any rod.

Read More Tower of Hanoi Problem