Computational geometry Algorithms for solving geometric problems in 2D and higher Fundamental objects: o point line segment
文件格式: PDF大小: 246.8KB页数: 28
ynamic order statistics OS-SELECT(i, S): returns the i th smallest element in the dynamic set S. OS-RANK(, S): returns the rank ofx E S in the sorted order of s s elements IDEA: Use a red-black tree for the set S, but keep subtree sizes in the nodes
文件格式: PDF大小: 227.41KB页数: 25
Balanced search trees Balanced search tree a search-tree data structure for which a height of o(g n)is guaranteed when implementing a dynamic set of n items
文件格式: PDF大小: 251.95KB页数: 29
Binary-search-tree sort 7∈ b Create an empty Bst for i=i to n do trEe-INSert(,AiD) Perform an inorder tree walk of t Example:
文件格式: PDF大小: 229.98KB页数: 34
a weakness of hashing Problem: For any hash function h, a set of keys exists that can cause the average access time of a hash table to skyrocket An adversary can pick all keys from tkeU: h(k)=i for some slot i IDEA Choose the hash function at random independently of the keys
文件格式: PDF大小: 145.78KB页数: 19
Symbol-table problem Symbol table T holding n records
文件格式: PDF大小: 147.48KB页数: 24
Order statistics Select the ith smallest of n elements(the element with rank i i=l: minimum, .i=n: marimum, i=L(n+1)/2]or[(n+1)/2 median Naive algorithm: Sort and index ith element Worst-case running time =o(n Ig n)+o(1 o(nIg n using merge sort or heapsort(not quicksort) c 2001 by Charles E Leiserson
文件格式: PDF大小: 321.33KB页数: 30
How fast can we sort? All the sorting algorithms we have seen so far are comparison sorts: only use comparisons to determine the relative order of elements E. g, insertion sort, merge sort, quicksort heapsort The best worst-case running time that weve seen for comparison sorting is O(nIgn) Is o(nlgn) the best we can do?
文件格式: PDF大小: 847.16KB页数: 47
Quicksort Proposed by C. A.R. Hoare in 1962 Divide-and-conquer algorithm Sorts“ in place”( like insertion sort, but not like merge sort Very practical(with tuning)
文件格式: PDF大小: 247.06KB页数: 47
The divide-and-conquer design paradigm 1. Divide the problem(instance) into subproblems 2. Conquer the subproblems by solving them recursively 3. Combine subproblem solutions
文件格式: PDF大小: 154.51KB页数: 27
©2025 mall.hezhiquan.com 和泉文库
帮助反馈侵权