## Print all possible solutions to N Queens problem

The N queens puzzle is the problem of placing N chess queens on an N × N chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column, or diagonal.

## Stack implementation in Java

This article covers the stack implementation in Java. A stack is a linear data structure which follows the LIFO (last-in first-out) principle. That means the objects can be inserted or removed only at one end of it also called as top.

## Print current date and time in C

Write a C program to print current date and time in standard output.

## Sieve of Eratosthenes

Sieve of Eratosthenes is a very efficient algorithm that can be used in most coding competitions involving prime numbers in the range of a given number n. The algorithm starts off by assuming that all the numbers in the range 2 to n are prime. Now we traverse the list starting from 2 to …

## Program to find n’th Fibonacci number

Write a program to calculate n’th Fibonacci number where n is a given positive number. Fibonacci sequence is characterized by the fact that every number after the first two is the sum of the two preceding ones. For example, consider below sequence – 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …

## Print all numbers between 1 to N without using semicolon

Write a program to print all numbers between 1 to N without using semicolon.

## Swap two numbers without using third variable | 5 methods

Given two integers, swap them without using any third variable.

## Queue implementation in java

A queue is a linear data structure which follows the FIFO (first-in first-out) principle. That means the object which is inserted first will be the first one out, followed by the object which was inserted next. The queue supports below core operations –

## 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”);

## Find maximum, minimum of three numbers without using conditional statement and ternary operator | 4 methods

Given three integers, find maximum and minimum number between them without using conditional statement or ternary operator.

## 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 …