12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2Mathematical PreliminariesThis chapter presents mathematical notation, background, <strong>and</strong> techniques usedthroughout the book. This material is provided primarily for review <strong>and</strong> reference.You might wish <strong>to</strong> return <strong>to</strong> the relevant sections when you encounter unfamiliarnotation or mathematical techniques in later chapters.Section 2.7 on estimating might be unfamiliar <strong>to</strong> many readers. Estimating isnot a mathematical technique, but rather a general engineering skill. It is enormouslyuseful <strong>to</strong> computer scientists doing design work, because any proposedsolution whose estimated resource requirements fall well outside the problem’s resourceconstraints can be discarded immediately.2.1 Sets <strong>and</strong> RelationsThe concept of a set in the mathematical sense has wide application in computerscience. The notations <strong>and</strong> techniques of set theory are commonly used when describing<strong>and</strong> implementing algorithms because the abstractions associated with setsoften help <strong>to</strong> clarify <strong>and</strong> simplify algorithm design.A set is a collection of distinguishable members or elements. The membersare typically drawn from some larger population known as the base type. Eachmember of a set is either a primitive element of the base type or is a set itself.There is no concept of duplication in a set. Each value from the base type is eitherin the set or not in the set. For example, a set named P might be the three integers 7,11, <strong>and</strong> 42. In this case, P’s members are 7, 11, <strong>and</strong> 42, <strong>and</strong> the base type is integer.Figure 2.1 shows the symbols commonly used <strong>to</strong> express sets <strong>and</strong> their relationships.Here are some examples of this notation in use. First define two sets, P<strong>and</strong> Q.P = {2, 3, 5}, Q = {5, 10}.25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!