Quad Tree is a tree with four pointers like North East, North West, South East and South West. Its used a lot in region query. Is there a way where I can find the min and max nodes a quad tree using some trick or is there some standard formula to find that out ?
Geeksoftie
0
Newbie Poster
Recommended Answers
Jump to PostThe simple solution is a recursive one. In pseducode that would look like:
int quad_max(root) { if (root.is_a_leaf) { return root.value } else { return max( quad_max(root.east), quad_max(root.south), quad_max(root.west), quad_max(root.north)) } }
Although, to be efficient you would probably want to implement a caching scheme to …
All 4 Replies
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
L7Sqr
227
Practically a Master Poster
mrnutty
761
Senior Poster
L7Sqr
227
Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.