LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Depth First Search (LIFO) - stacked based

Hi Everyone, 

 

Herewith attached my workable Breadth fist search (FIFO) code - queue based. Now, I would like to change to LIFO - stacked based. 

 

Anyone here can give some guideline on it?

 

Many thanks.  

0 Kudos
Message 1 of 7
(4,013 Views)

Use enqueue data at the opposite end, and normal dequeue will give pretty much the same result as stack.

0 Kudos
Message 2 of 7
(3,990 Views)

Hi KateB, 

 

i've just realized that the attached code is queue stacked based which is meaned queued LIFO. What if I want to change to FIFO? what should i change? Any guideline on it? 

0 Kudos
Message 3 of 7
(3,983 Views)

use simple enqueue functionSmiley Wink

0 Kudos
Message 4 of 7
(3,965 Views)

I've changed it to queue FIFO. but in the end, it won't show a complete path to reach the destination point. However, queue stack LIFO can show a complete path from starting point till the goal point.

 

Does that means queue FIFO cannot be used in finding a complete path out? Is there any possible way for this method to find its way out? 

 

Herewith attached queue FIFO. 

0 Kudos
Message 5 of 7
(3,961 Views)

So when is your homework due?

0 Kudos
Message 6 of 7
(3,945 Views)

Hi Intaris,

 

On this coming week. 

0 Kudos
Message 7 of 7
(3,940 Views)