MySQL Forums
Forum List  »  General

Re: Modified Preorder Tree Traversal - Advanced question
Posted by: Clive Galway
Date: August 23, 2005 03:14PM

Let me clarify a few more things.

There is NO given starting region, just a zoomlevel to go by. You could assume the root region as the "starting point"

Let me expand the test data to make it a bit better, I oversimplified a bit.

.....................................Root(15)...............................
................UK(5)............................... US (7) ...............
..Scotland(3)....England(4)......Texas(6)......Conneticut(3)...
.......................Surrey(1).......Dallas(4).......Hartford(2).....

Notice that texas is zoom 6, and UK is zoom 5.

Variables to be used:
zoomlevel
entrypoint (eg "Root" or "UK") - I would settle for this being hard-wired as the root. As it is my table's root is always region 1 anyway.

Return the regions that are a child of entrypoint and with a zoom <= zoomlevel
BUT ONLY THE FIRST ONE, NOT ALL CHILDREN.

Examples (all using root as the entrypoint)
Zoomlevel : Result
14 : UK, US
7 : UK, US
6 : UK, Texas, Conneticut
5 : UK, Dallas, Conneticut
4 : Scotland, England, Dallas, Conneticut
3 : Scotland, Surrey, Dallas, Hartford
2 : Scotland, Surrey, Dallas, Hartford

Thanks for the help !

Options: ReplyQuote


Subject
Written By
Posted
Re: Modified Preorder Tree Traversal - Advanced question
August 23, 2005 03:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.