programminga general overview we now know that operator[should return an entity of type vector should we use return-by-valuereturn-by-referenceor return-by-constant-referenceimmediately we eliminate return-by-valuebecause the returned entity is large but guaranteed to exist after the call thuswe are down to return-by-reference or return-by-constant-reference consider the following method (ignore the possibility of aliasing or incompatible sizesneither of which affects the algorithm)void copyconst matrix frommatrix to forint to numrows)++ toi fromi ]in the copy functionwe attempt to copy each row in matrix from into the corresponding row in matrix to clearlyif operator[returns constant referencethen to[icannot appear on the left side of the assignment statement thusit appears that operator[should return reference howeverif we did thatthen an expression such as from[ ]=to[iwould compilesince from[iwould not be constant vectoreven though from was constant matrix that cannot be allowed in good design so what we really need is for operator[to return constant reference for frombut plain reference for to in other wordswe need two versions of operator[]which differ only in their return types that is not allowed howeverthere is loopholesince member function const-ness ( whether function is an accessor or mutatoris part of the signaturewe can have the accessor version of operator[return constant referenceand have the mutator version return the simple reference thenall is well this is shown in figure big-five these are all taken care of automaticallybecause the vector has taken care of it thereforethis is all the code needed for fully functioning matrix class summary this sets the stage for the rest of the book the time taken by an algorithm confronted with large amounts of input will be an important criterion for deciding if it is good algorithm (of coursecorrectness is most important we will begin to address these issues in the next and will use the mathematics discussed here to establish formal model exercises write program to solve the selection problem let / draw table showing the running time of your program for various values of write program to solve the word puzzle problem