Programming Assignment 1:
A Data Structure For Game Programming
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.
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.