Test #1 questions. Two questions from the following listr will be given on the test, plus one "practical" problem (such as, define the efficiency of a program fragment, trace a data structure, etc.) 1. Explain why it is important to know the run time efficiency of an algorithm, and how this knowledge helps us decide which algorithm among several possible ones is the best for a given application. Define the big-O notation and explain how well it allows us to classify algorithms in practice. Give examples to show potential problems with the big-O analysis. 2. Explain and compare selection, insertion and bubble sorts. Assume that your application (say a data base application) deals with large records where comparisons are performed by means of integer keys. Assume also that it requires a stable sorting method (i.e. a method which does not change the relative ordering of equal keys). Which one of the elementary sorting methods would you choose, and why? (Hint: consider an example on the following integer keys 19, 14(1), 7, 12, 14(2), 10) 3. Describe the divide-and-conquer search algorithm and explain its efficiency. Consider two different Split functions: Split = Lo, and Split = (Lo + Hi) / 2. Assume that we are searching a large data base with 4 million items represented as an ordered array. How many probes into the list will the binary search require before finding the target or concluding that it cannot be found? Assuming that it takes 1 microsecond to access an item, estimate the execution time of the binary search. 4. Explain how the efficiency of recursive algoriths is defined. Consider two examples: the recursive binary search, and the tower of Hanoi problem. Draw trees of recursive calls for both problems, and compare their efficiencies. What is a recurrence relation, and how does it help us define algorithm efficiency? 5. What is an Abstract Data Type (ADT) and what is a data structure? Explain the levels of abstraction in data specification. Consider the Matrix ADT example to illustrate your explanation. 6. Describe the Queue ADT (give a definition, set of operations). Explain and compare array and linked list implementations of the Queue ADT. Explain how queues are used in the Radix sort, and explain the Radix sort itself. Discuss the efficiency of the Radix sort. 7. Describe the Stack ADT (give a definition, set of operations). Explain one stack application -- your choice. Can be converting expressions from infix to postfix form or evaluation of arithmetic (or logical) expressions. 8. Describe the List ADT (give a definition, set of operations). Describe different versions of the List ADT (ordered, unordered) and their implementations (array implementation, linked list implementation and doubly linked list implementation). Define the Double-Ended Queue ADT. 9. Describe the Ranked Sequence ADT (give a definition, set of operations). Compare the array-based and the doubly linked list implementation of the Ranked Sequence ADT. 10. Describe the Positional Sequence ADT (give a definition, set of operations). Explain the notion of a position. Explain how the Positional Sequence is different from the Ranked Sequence. 11. Describe the Shell Sort algorithm and explain why it is not amanable to the big-O analysis. Explain how we evaluate the run time efficiency in this case. 12. Explain and compare Quick and Merge sorts. How the run-time efficiency of recursive sorting algorithms compare to that of iterative sorting algorithms.