11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

456 Chap. 13 Advanced Tree <strong>Structures</strong>Implement the suffix tree for a dictionary of words or phrases, with supportfor wildcard search.13.3 Revise the BST class of Section 5.4 to use the AVL tree rot<strong>at</strong>ions. Your newimplement<strong>at</strong>ion should not modify the original BST class ADT. Compareyour AVL tree against an implement<strong>at</strong>ion of the st<strong>and</strong>ard BST over a widevariety of input d<strong>at</strong>a. Under wh<strong>at</strong> conditions does the splay tree actually savetime?13.4 Revise the BST class of Section 5.4 to use the splay tree rot<strong>at</strong>ions. Your newimplement<strong>at</strong>ion should not modify the original BST class ADT. Compareyour splay tree against an implement<strong>at</strong>ion of the st<strong>and</strong>ard BST over a widevariety of input d<strong>at</strong>a. Under wh<strong>at</strong> conditions does the splay tree actually savetime?13.5 Implement a city d<strong>at</strong>abase using the k-d tree. Each d<strong>at</strong>abase record containsthe name of the city (a string of arbitrary length) <strong>and</strong> the coordin<strong>at</strong>es of thecity expressed as integer x- <strong>and</strong> y-coordin<strong>at</strong>es. Your d<strong>at</strong>abase should allowrecords to be inserted, deleted by name or coordin<strong>at</strong>e, <strong>and</strong> searched by nameor coordin<strong>at</strong>e. You should also support region queries, th<strong>at</strong> is, a request toprint all records within a given distance of a specified point.13.6 Implement a city d<strong>at</strong>abase using the PR quadtree. Each d<strong>at</strong>abase record containsthe name of the city (a string of arbitrary length) <strong>and</strong> the coordin<strong>at</strong>esof the city expressed as integer x- <strong>and</strong> y-coordin<strong>at</strong>es. Your d<strong>at</strong>abase shouldallow records to be inserted, deleted by name or coordin<strong>at</strong>e, <strong>and</strong> searched byname or coordin<strong>at</strong>e. You should also support region queries, th<strong>at</strong> is, a requestto print all records within a given distance of a specified point.13.7 Implement <strong>and</strong> test the PR quadtree, using the composite design to implementthe insert, search, <strong>and</strong> delete oper<strong>at</strong>ions.13.8 Implement a city d<strong>at</strong>abase using the bintree. Each d<strong>at</strong>abase record containsthe name of the city (a string of arbitrary length) <strong>and</strong> the coordin<strong>at</strong>es of thecity expressed as integer x- <strong>and</strong> y-coordin<strong>at</strong>es. Your d<strong>at</strong>abase should allowrecords to be inserted, deleted by name or coordin<strong>at</strong>e, <strong>and</strong> searched by nameor coordin<strong>at</strong>e. You should also support region queries, th<strong>at</strong> is, a request toprint all records within a given distance of a specified point.13.9 Implement a city d<strong>at</strong>abase using the point quadtree. Each d<strong>at</strong>abase recordcontains the name of the city (a string of arbitrary length) <strong>and</strong> the coordin<strong>at</strong>esof the city expressed as integer x- <strong>and</strong> y-coordin<strong>at</strong>es. Your d<strong>at</strong>abase shouldallow records to be inserted, deleted by name or coordin<strong>at</strong>e, <strong>and</strong> searched byname or coordin<strong>at</strong>e. You should also support region queries, th<strong>at</strong> is, a requestto print all records within a given distance of a specified point.13.10 Use the PR quadtree to implement an efficient solution to Problem 6.5. Th<strong>at</strong>is, store the set of points in a PR quadtree. For each point, the PR quadtreeis used to find those points within distance D th<strong>at</strong> should be equivalenced.Wh<strong>at</strong> is the asymptotic complexity of this solution?

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

Saved successfully!

Ooh no, something went wrong!