Elementary Data Structures
Abstract data type = Data structure + Methods on the structure
Building blocks Types Set of bits to be used to represent data Functions Operations to manipulate on the data Data type . Set of values and a collection of operation
Principles of Algorithm Analysis
Key to good understanding of algorithms for practical applications We do not analyze every program we write Enough to understand basic [standard] algorithms and their performance so that we can select the best algorithm f
Minimum Spanning Trees Spanning tree Problem of connecting pins in an electronic circuit with wires n pins can be connected with an arrangement of n 1 wires Well like to use an arrangement that minimizes the amount of wire used Dened as a connected graph
Hashing
Consider the key-indexed search method that we studied earlier with symbol tables
Uses key value as array index rather than comparing the keys
Depends on the keys being distinct, and mappable to distinct integers to provide for the index within
Elementary Sorting Methods
Simple sorting methods Useful if the sorting program is to be used a few times, or if the sorting program is used over a small amount of data to be sorted at any time Useful for small les, because of low overhead Useful for wel
Balanced Trees
bst algorithms can degenerate to worst case performance, which is bad because the worst case is likely to occur
in practice, with ordered les, for example
We will like to keep our trees perfectly balanced (ideally speaking)
Corresponds t
Symbol Tables and Binary Search Trees
Search
Basic operation for retrieval of a specic piece of information from large volume of previously stored data
Each data item divided into two parts
1. Key used for searching
2. Record information to be looked fo
Introduction Algorithms Method for solving problems suitable for computer implementation Generally independent of computer hardware characteristics Possibly suitable for many different programming languages Input and output for algorithms Problem must be
Recursion and Trees
Recursive Code A program that calls itself and stops when a termination condition is achieved.
Recursive algorithms Solves a problem by solving one or more of smaller instances of the same problem Recursive functions in programming lan