The following problems refer to Snailsort. We want to count the number of comparisons. For each problem write out a summation and then simplify the… The following problems refer to Snailsort. We want to count the number of comparisons. Foreach problem write out a summation and then simplify the summation. Make your analyses asexact as possible.i <- 1while i < n do if a[i]>a[i+1]...