Design and implement a backtracking algorithm

Assignment Help Basic Computer Science
Reference no: EM131252753

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.

Reference no: EM131252753

Questions Cloud

Describe the nonfunctional requirements : Include a short description of the function being supported, a detailed description of the requirements, and how they will be measured during testing. Describe the nonfunctional requirements, also known as attributes of the system addressing area..
Write a program implementing a backtracking algorithm : The general template for backtracking algorithms, which is given in the section, works correctly only if no solution is a prefix to another solution to the problem. Change the template's pseudocode to work correctly without this restriction.
Understand consumer behavior in order : Marketers need to recognize and understand consumer behavior in order for their business to be successful. List and explain why understanding consumer behavior is so important. This must include several examples. Also within your explanation show..
Is this measurement a positive or negative thing : Is this measurement a positive or negative thing? Does it bring people closer to or push them further from knowledge of themselves and/or others
Design and implement a backtracking algorithm : 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.
Determine that company strengths and weaknesses : "Internal Environment" Please respond to the following: CHOOSE A COMPANY you researched to determine that company's strengths and weaknesses.  Be as specific as possible.
Describe the issue tell us why it is important : In this forum, propose a topic for discussion with the class. Describe the issue, tell us why it is important to you, perhaps give us some of your own thoughts about it, and pose some questions that you think will lead to useful discussion
What recommendations would you have for developing countries : Contrasting the lessons learned in the US and the UK what recommendations would you have for developing countries considering healthcare system implementations (note that you could strengthen your argument by comparing the US and UK systems to the..
How many nodes will be in the state-space tree : In the best case, how many nodes will be in the state-space tree of the branch-and-bound algorithm for the assignment problem?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What are some of its challenges

Analyze and discuss how the Health Insurance Portability and Accountability Act (HIPPA) helps to improve the U.S. healthcare industry. What are some of its challenges?

  Identify the flow of events within each use case

Draw a use case diagram for the following dentist office system, but do not bother to identify the flow of events within each use case. Whenever new patients are seen for the first time, they complete a patient information form that asks their nam..

  Solve the handshake question

Consider this problem: four people come to a party and shake hands with each other. If each shakes the hand of every other person, how many handshakes were there in all? Design a mathematical model to solve the handshake question. Explain the solu..

  Write an insert statement to add all of the rows

Assume that you have a table named NEW_EMPLOYEE that has the columns Department, Email, First Name, and Last Name, in that order. Write an INSERT statement to add all of the rows from the table NEW_EMPLOYEE to EMPLOYEE. Do not attempt to run this ..

  Word-processing program while running windows

Imagine that every time you try to use your word-processing program while running Windows 7, your system slows down or freezes. Which Windows monitoring tool (Windows Task Manager

  Average of the values in an array of doubles

Question 1: Write a method that computes the average of the values in an array of doubles. The header of the method is as follows:

  What is the new profit maximizing number of students

What is the relevance of the marginal rule (MR = MC) in your decision making?

  Create a Online shopping program

Please use comments throughout the program Point  has to be taken into consideration: Object-oriented programming Inheritance, encapsulation, and polymorphism

  Write a class encapsulating the concept of a rational number

Write a class encapsulating the concept of a rational number, assuming a rational number has the following attributes: an integer representing the numerator of the rational number another integer representing the denominator of the rational number

  Comment on the performance and scalability of this scheme

Comment on the performance and scalability of this scheme.

  Provide your opinion on the gui versus the command line

provide your opinion on The GUI versus the Command Line. Use the Internet to research the long standing debate of the "GUI versus the Command Line". Based on your research and what you have learned so far in this class.

  Graphical interface coding and give example

What name Do we give to a Software Used to Develop but offers a functionality for immediate view of a Graphical Interface Coding and give example?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd