loosequad - Fall 2011 CMSC 420 Hanan Samet Programming...

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

View Full Document Right Arrow Icon
Fall 2011 CMSC 420 Hanan Samet Programming Assignment 1: A Data Structure For Game Programming 1 Abstract In this assignment you are required to implement a system for handling data similar to that used in game programming. In such an environment the primary entities are small rectangles and the problem we are interested is how to manage a large collection of them. In the following we trace the development of a variant of the quadtree data structure that has been found to be useful for such problems. Your task is to implement this data structure in such a way that a number of operations can be handled efficiently. An example JAVA applet for the data structure can be found on the home page of the class. This assignment is divided into four parts. C, C++, or PASCAL are the permitted program- ming languages. JAVA is not permitted. Also, you are not allowed to make use of any built in data structures from any library such as, but not limited to, STL in C++. For the first two parts, you must read the attached description of the problem and data structure. A detailed explanation of the assignment including the specification of the operations which you are to implement is found at the end of the description. After you have done this, you are to turn in a proposed im- plementation of the data structure using C++ classes, C structs, or PASCAL record definitions. One week later you must turn in a C++, C, or PASCAL program for the command decoder (i.e., scanner for the commands corresponding to the operations which are to be performed on the data structure). For the third part, you are to write a C++, C, or PASCAL program to implement the data structure and operations (1)-(9). For the fourth part, you are to implement operations (10)-(15). Operations (16)-(18) are optional and you will get extra credit if you turn them in with part four. If you are a graduate student, part four is not optional. 1 Copyright c c 2011 by Hanan Samet. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the express prior permission of the author.
Background image of page 1

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

View Full DocumentRight Arrow Icon
1 Region-Based Quadtrees The quadtree is a member of a class of hierarchical data structures that are based on the principle of recursive decomposition. As an example, consider the point quadtree of Finkel and Bentley [2] which should be familiar to you as it is simply a multidimensional generalization of a binary search tree. In two dimensions each node has four subtrees corresponding to the directions NW , NE , SW , and SE . Each subtree is commonly referred to as a quadrant or subquadrant. For example, see Figure 1.14 2 where a point quadtree of 8 nodes is presented. In our presentation we shall only discuss two-dimensional quadtrees although it should be clear that what we say can be easily generalized to more than two dimensions. For the point quadtree, the points of decomposition are the data
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/13/2012 for the course CMSC 420 taught by Professor Staff during the Fall '08 term at Maryland.

Page1 / 11

loosequad - Fall 2011 CMSC 420 Hanan Samet Programming...

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

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