imagine that you have been hired to design database service containing information about cities and towns in the united statesas described in example suggest two possible implementations for the database imagine that you are given an array of records that is sorted with respect to some key field contained in each record give two different algorithms for searching the array to find the record with specified key value which one do you consider "betterand why how would you go about comparing two proposed algorithms for sorting an array of integersin particular(awhat would be appropriate measures of cost to use as basis for comparing the two sorting algorithms(bwhat tests or analysis would you conduct to determine how the two algorithms perform under these cost measures common problem for compilers and text editors is to determine if the parentheses (or other bracketsin string are balanced and properly nested for examplethe string "((())())()contains properly nested pairs of parenthesesbut the string ")()(does notand the string "())does not contain properly matching parentheses (agive an algorithm that returns true if string contains properly nested and balanced parenthesesand false if otherwise hintat no time while scanning legal string from left to right will you have encountered more right parentheses than left parentheses (bgive an algorithm that returns the position in the string of the first offending parenthesis if the string is not properly nested and balanced that isif an excess right parenthesis is foundreturn its positionif there are too many left parenthesesreturn the position of the first excess left parenthesis return - if the string is properly balanced and nested graph consists of set of objects (called verticesand set of edgeswhere each edge connects two vertices any given pair of vertices can be connected by only one edge describe at least two different ways to represent the connections defined by the vertices and edges of graph imagine that you are shipping clerk for large company you have just been handed about invoiceseach of which is single sheet of paper with large number in the upper right corner the invoices must be sorted by this numberin order from lowest to highest write down as many different approaches to sorting the invoices as you can think of