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

  Vulnerabilities in the tested environment

The Software Development Life Cycle (SDLC) includes testing to ensure applications meet business requirements, functions as planned, and ensures the data contained within the cannot be compromised. A security assessment identifies vulnerabilities ..

  Holding blocks of disk in memory

Disk caching is a technique that is used to speed up disk access by holding blocks of disk in memory. Discuss strategies that could be used to improve system performance with disk caching.

  Generates output that is redirected to a file or pipe

Suppose we execute a long-running program that slowly generates output that is redirected to a file or pipe, as in this example:$ longrunner | grep str

  Outline a new it security policy

You have been hired by the Board of Directors of RollinOn, Inc as the new IT Security Manager. RollinOn is a designer of premade and custom designed skates and skateboards.

  Future academic studies or in professional work

Reflect on the writing process you have used in this course and how you think you might change it in the future, based on what you have learned during the last few weeks. Additionally, identify any progress you think you have made in your writing ..

  What could you do to violate individuals privacy rights

Privacy policies are found all over the Web. Pick three web sites with privacy policies and compare and contrast them. What do they include and what is missing?

  Which of the following cisco ios firewall router commands

Which of the following Cisco IOS firewall router commands correctly configures authentication and encryption for an IPSec transform set?

  How many leaf nodes are there

Generalize your answer for part (a). In a binary tree with x + y internal nodes, where x of them have 2 children, and y of them have 1 child, how many leaf nodes are there?

  Examine & analyze the principles of polymorphism,inheritance

The team should then discuss each of the principles and examples. Determine whether descriptions capture the principle in a detailed and accurate manner. Examples should be discussed relative to appropriateness. Would there be a better example for..

  Memory and prepared for execution

An executable program file is brought into memory and prepared for execution at:a. Compile time. b. Link time. c. Load time. d. Execution time.

  Turing machine that decreases positive binary number by one

Write a Turing machine that decreases a positive binary number by one? By writing turing machine an instruction set in the form of (w,x,y,z,a) where w is current state,

  Highlight the importance of operation masters

The purpose of this assessment is to highlight the importance of operation masters in Windows Server 2012/R2. In addition, the assessment will help differentiate between various operation masters.

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