Difference between revisions of "Part 2"

From CMSC 420
m (put in a warning that summer 2007 and 2008 use b+ tree, not b tree.)
m (→‎Data structures: replace btree references with bptree (bplus tree))
Line 8: Line 8:
  
 
== Data structures ==
 
== Data structures ==
# Data Dictionary ([[BTree.java |B-tree]] for part 2)
+
# Data Dictionary ([[BPTree.java |B+ tree]] for part 2)
 
#* Related commands:
 
#* Related commands:
 
#** [[createCity]]
 
#** [[createCity]]
 
#** [[listCities]]
 
#** [[listCities]]
 
#** [[clearAll]]
 
#** [[clearAll]]
#** [[printBTree]]
+
#** [[printBPTree]]
 
# Spatial Map ([[PM Quadtree#PM3 Quadtree |PM3 Quadtree]] for part 2)
 
# Spatial Map ([[PM Quadtree#PM3 Quadtree |PM3 Quadtree]] for part 2)
 
#* Related commands:
 
#* Related commands:

Revision as of 19:13, 10 June 2008

  • Not Current for Summer 2007 or 2008 ( no more btree---we use the b+ tree)
  • The official spec is Draft 2.1.
  • As always, the spec will freeze 1 week prior to the due date.
  • Test Files

Overview[edit]

For this part of the project, you will implement a B-Tree that implements the SortedMap interface. However, you do not need to implement deletion operations until Part 3. The B-tree will become the new data dictionary. The spatial map will now use a PM3 Quadtree to store both cities and roads. You will also be required to make a road adjacency list for use in finding the shortest path between two cities.

Data structures[edit]

  1. Data Dictionary (B+ tree for part 2)
  2. Spatial Map (PM3 Quadtree for part 2)
  3. Road Adjacency List

Commands[edit]

The operations you will need to implement are in the spec:

  • createCity: You will need to be able to add cities to the data dictionary. No two cities can have the same coordinates or name.
  • mapRoad: Map a road in the spatial map.
  • listCities: Output a sorted (XML) list of cities in the data dictionary.
  • rangeCities: This searches the spatial data structure for all cities within a given radius of a given point. Optionally save a visual representation of the command to an image file.
  • nearestCity: This finds the nearest city in the spatial map to a given point.
  • printBTree: This outputs an XML representation of the data dictionary.
  • printPMQuadtree: This outputs an XML (textual) representation of the spatial map.
  • saveMap: This outputs a visual representation (an image) of the spatial data structure. See CanvasPlus.
  • clearAll: Clears all of the data structures, removing all elements.
  • shortestPath: Computes the shortest path between two cities. Optionally saves the path to an image file using CanvasPlus or generates an HTML file for the shortest path using XSLT.