Skip to content

Instantly share code, notes, and snippets.

@jhgaylor
Forked from anonymous/gist:3074475
Created July 9, 2012 06:14
Show Gist options
  • Save jhgaylor/3074494 to your computer and use it in GitHub Desktop.
Save jhgaylor/3074494 to your computer and use it in GitHub Desktop.
from classes import Point, QuadTree
import sys
pt1 = Point(0,0)
points = []
for i in range(-2,1):
for j in range(-2,1):
tmp = Point(i,j)
points.append(tmp)
#for pt in points:
# print pt
qt = QuadTree(pt1)
for pt in points:
try:
qt.insert(pt)
except:
print str(pt) + " is already exists in the tree."
print qt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment