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
The pre-order and post order traversal of a Binary Tree generates the same output. The tree can have maximum One node

how to define the size of array

Design  and implement  an algorithm  to simulate car  re-organizing of the train at the railway switching junction. You can only use stacks as the data structure to represent the t

A significant aspect of Abstract Data Types is that they explain the properties of a data structure without specifying the details of its implementation. The properties might be im

Q. A linear array A is given with lower bound as 1. If address of A[25] is 375 and A[30] is 390, then find address of A[16].

Create main method or a test class that creates 2 Element objects that are neighbours of each other, the first element temperature set at 100, the 2nd at 0 and use an appropriate h

what is circular doubly link list?write down the algorithm for insertion of elements in circular doubly link list

MID SQUARE METHOD

Evaluate the frequency counts for all statements in the following given program segment. for (i=1; i ≤ n; i ++) for (j = 1; j ≤ i; j++) for (k =1; k ≤ j; k++) y ++;

We will start by defining a new structure called Heap. Figure 3 illustrates a Binary tree. Figure: A Binary Tree A complete binary tree is said to assure the 'heap con