Stack Algorithm Using Array Sql