better greedy algorithm is presented here this timethe function returns list of tuples that allow us to investigate the better resultsdef optimal_small_change(denomtotal_amount)sorted_denominations sorted(denomreverse=trueseries [for in range(len(sorted_denominations))term sorted_denominations[ :number_of_denoms [local_total total_amount for in termdiv local_total local_total local_total if div number_of_denoms append((idiv)series append(number_of_denomsreturn series the outer for loop enables us to limit the denominations from which we find our solutionfor in range(len(sorted_denominations))term sorted_denominations[ :assuming that we have the list [ in sorted_denominationsslicing it with [ :helps us obtain the sublists [ ][ ]and [ ]from which we try to get the right combination to create the change dijkstra' shortest path algorithm we introduce and study dijkstra' algorithm this algorithm is an example of greedy algorithm it finds the shortest distance from source to all other nodes or vertices in graph by the end of this sectionyou will come to understand why it is classified as greedy algorithm