Python Program to Solve n-Queen Problem without Recursion

This is a Python program to solve the n-queen problem without recursion. Problem Description The n-queen problem is the problem of placing n queens on an n x n chessboard such that no queen can attack another queen. Problem Solution 1. Create a class QueenChessBoard. 2. The board configuration is stored in a list called … Read more

advertisement

Celebrity Problem in Python

This is a Python program to solve the celebrity problem. Problem Description The celebrity problem is the problem of finding the celebrity among n people. A celebrity is someone who doesn’t know anyone (including themselves) but is known by everyone. The problem is to find who the celebrity is by asking people questions of the … Read more

advertisement

Python Program to Solve n-Queen Problem with Recursion

This is a Python program to solve the n-queen problem with recursion. Problem Description The n-queen problem is the problem of placing n queens on an n x n chessboard such that no queen can attack another queen. Problem Solution 1. Create a class QueenChessBoard. 2. The board configuration is stored in a list called … Read more

advertisement

Tower of Hanoi Program in Python

This is a Python program to implement Tower of Hanoi. Problem Description The program prompts the user for the number of disks n and the program prints the procedure to move n disks from peg A to peg C using peg B. Problem Solution 1. Create function hanoi that takes the number of disks n … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.