usesequeuestacktoimplementthesolutionofmazeBYc,greedyalgorithm