AlgorithmicComplexity

- BioE131 Algorithmic Complexity Midterm Review Binary Chop Balanced Trees 9 12 14 17 19 23 50 54 67 72 76 Start with a sorted list 9 12 14 17 19

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
BioE131 Algorithmic Complexity & Midterm Review
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Start with a sorted list. Compare the middle element with the one we want. Narrow the search to the half of the list that contains our element. Iterate this procedure to "home in" on the right element. This takes log 2 (N) steps. A balanced tree is similar to a sorted list, but the search paths are stored explicitly. There are at most log 2 (N) steps to any node from the root. 9 12 14 17 19 23 50 54 67 72 76 9 12 14 17 19 23 50 54 67 72 76 9 12 14 17 19 23 50 54 67 72 76 9 12 14 17 19 23 50 54 67 72 76
Background image of page 2
Algorithmic Complexity: Searching and Sorting Binary chop search of N items: O(log N) time, constant space Adding an item to a balanced binary tree: same as binary chop Building a balanced binary tree of N items: O(N log N) time, O(N) space Sorting N items: same as balanced binary tree
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Databases and SQL Database engines (MySQL, etc.) Efficient indexing, sorting, searching More robust than filesystems for storage
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/03/2011 for the course BIO 118 taught by Professor Staff during the Fall '08 term at Rutgers.

Page1 / 14

- BioE131 Algorithmic Complexity Midterm Review Binary Chop Balanced Trees 9 12 14 17 19 23 50 54 67 72 76 Start with a sorted list 9 12 14 17 19

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online