algorithm analysis evaluate each of the following code segments and determine the (*for the best and worst cases assume an input size of (cfor in rangen (asum if = for in rangen sum + elif = for in range sum + else for in rangen sum + for in rangen if = sum + (bsum while sum + the slice operation is used to create new list that contains subset of items from source list implement the slice(functiondef slicethelistfirstlast which accepts list and creates sublist of the values in thelist what is the worst case time for your implementation and what is the best case time implement the remaining methods of the sparsematrix classtranspose()getitem subtract()and multiply( determine the worst case time-complexities for the sparsematrix methods implemented in the previous question determine the worst case time-complexities for the methods of your reversigamelogic class implemented in programming project add python operator methods to the sparsematrix class that can be used in place of the named methods for several of the operations operator method add (rhsmatrixmul (rhsmatrixsub (rhsmatrixcurrent method add(rhsmatrixsubtract(rhsmatrixmultiply(rhsmatrixprogramming projects the game of life is defined for an infinite-sized grid in we defined the life grid adt to use fixed-size grid in which the user specified the width and height of the grid this was sufficient as an illustration of the use of - array for the implementation of the game of life but full implementation should allow for an infinite-sized grid implement the sparse life grid adt using an approach similar to the one used to implement the sparse matrix