Advantages:
Uniform cost search is optimal because at every state the path
with the least cost is chosen.
Disadvantages:
It does not care about the number of steps involve in searching and
only concerned about path cost. Due to which this algorithm may be
stuck in an infinite loop.