[48765 views]

**Problem Statement:** Place n-queens in n x n chessboard so that no two of them can attack each other i.e no two of them are on the same row, column or diagonal. In this problem backtracking is done to solve the problem. solutions of this problems are expressed in n-tuple.

In the above algorithm,

- For the n queen problem we take input of n, lets say n=4 so, k=1,2,3,4.
- For placing the first queen i.e k=1,we start a loop for n columns i.e n=4 so till the fourth column.
- The first queen can be placed at first column only.
- Then we move for the second queen and place it seeing that the first queen is not in the same column or in diagonal with the second queen.
- Similarly, the third queen and the fourth queen are placed. But if the fourth queen cannot be placed as it lies in same column or is in diagonal with other queens then back-tracking is done to the previous queens in order of 3,2,1 to achieve the unique feasible solution.
- For an n problem queen the same way all the n queens are placed and if the n
^{th}cannot be placed back-tracking is done and the queens are re-ordered and solution is obtained.

- Java IDE Online
- Python IDE Online
- JSON Formatter/Minifier Online
- Case Converter
- Reverse String
- HTML Encoder
- HTML Decoder
- URL Encoder
- URL Decoder
- Decimal To Binary
- Binary To Decimal
- Decimal To Octal
- Binary To Octal
- Decimal To Hexadecimal
- Hexadecimal To Decimal
- Hexadecimal To Binary
- Octal To Decimal
- Octal to Hexadecimal
- Octal to Binary
- Calculate String Length
- Remove Spaces
- Remove Line Breaks
- Remove Empty Lines
- Remove Duplicate Lines
- Word Counter
- Replace Space with hyphen
- Check Armstrong number
- Text to URL

- Algorithm and Flowchart to find the prime factors of a number
- Flowchart and Algorithm to Replace Lower Case to Upper Case in a String or Sentence
- Algorithm and Flowchart to Reverse a String
- Algorithm and Flowchart to check whether a given number is buzz number or not
- Pseudocode and Flowchart for Bubble Sort