Perform depth -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 Depth -First search but after the initial {0,0} state, continue your search from the {0,3} successor instead of the {4,0} successor.

 

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







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

Write discussion on Perform depth -first search
Your posts are moderated
Related Questions
The following formula is used to calculate n: n = x * x/(1 - x) . Value x = 0 is used to stop algorithm. Calculation is repeated using values of x until value x = 0 is input. There

Q. Write down an algorithm for finding a key from a sorted list using the binary search technique or method.

Example 3: Travelling Salesman problem Given: n associated cities and distances among them Find: tour of minimum length that visits all of city. Solutions: How several

What is a first-in-first-out data structure ? Write algorithms to perform the following operations on it – create, insertion, deletion, for testing overflow and empty conditions.

Define Dynamic Programming  Dynamic  programming  is  a  method  for  solving  problems  with  overlapping  problems.  Typically, these sub problems arise from a recurrence rel

Multidimensional array: Multidimensional arrays can be defined as "arrays of arrays". For example, a bidimensional array can be imagined as a bidimensional table made of elements,

Define a sparse metrics. A matrix in which number of zero entries are much higher than the number of non zero entries is known as sparse matrix. The natural method of showing m

Q. What is the need of using asymptotic notation in the study of algorithm? Describe the commonly used asymptotic notations and also give their significance.

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

Merge sort is also one of the 'divide & conquer' classes of algorithms. The fundamental idea in it is to split the list in a number of sublists, sort each of these sublists & merge