Perform breadth -first search, Data Structure & Algorithms

You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring marker on it. There is a tap that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into the 4-gallon jug?

Use Breadth -First search i.e. finish expanding each row before going to the next one. It means expanding the {4,0} followed by the {0,3} states before going to their successors on the next row.

 

Posted Date: 3/15/2013 2:56:49 AM | Location : United States







Related Discussions:- Perform breadth -first search, Assignment Help, Ask Question on Perform breadth -first search, Get Answer, Expert's Help, Perform breadth -first search Discussions

Write discussion on Perform breadth -first search
Your posts are moderated
Related Questions
characteristics of a good algorithm

Question 1 Explain the use of algorithms in computing Question 2 Explain time complexity and space complexity of an algorithm Question 3 Explain how you can analyz

Illustrate the intervals in mathematics Carrier set of a Range of T is the set of all sets of values v ∈ T such that for some start value s ∈ T and end value e ∈ T, either s ≤

Queue is a linear data structure utilized in several applications of computer science. Such as people stand in a queue to get a specific service, several processes will wait in a q

Your program should include three components selling, buying and managing for the use of sellers, buyers and the Manager, respectively. Provide a menu for a user to enter each comp

Determine the greatest common divisor (GCD) of two integers, m & n. The algorithm for GCD might be defined as follows: While m is greater than zero: If n is greater than m, s


1. In computer science, a classic problem is how to dynamically store information so as to let for quick look up. This searching problem arises frequently in dictionaries, symbol t

write an algorithm and draw a flowchart to calculate the perimeter and area of a circle

What is the difference between a grounded header link list and a circular header link list? A header linked list is a linked list which always having a special node, known as t