Starting with a given location of the empty hole find a


Puzzle pegs This puzzle-like game is played on a board with 15 small holes arranged in an equilateral triangle. In an initial position, all but one of the holes are occupied by pegs, as in the example shown below. A legal move is a jump of a peg over its immediate neighbor into an empty square opposite; the jump removes the jumped-over neighbor from the board.

2372_d1b7dd51-396e-40c0-af8f-6d8d24531206.png

Design and implement a backtracking algorithm for solving the following versions of this puzzle.

a. Starting with a given location of the empty hole, find a shortest sequence of moves that eliminates 14 pegs with no limitations on the final position of the remaining peg.

b. Starting with a given location of the empty hole, find a shortest sequence of moves that eliminates 14 pegs with the remaining peg at the empty hole of the initial board.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Starting with a given location of the empty hole find a
Reference No:- TGS01656590

Expected delivery within 24 Hours