Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Finding the root of a binary tree.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
zippoxer
Newbie cheater
Reputation: 0

Joined: 04 Feb 2008
Posts: 23

PostPosted: Thu Oct 13, 2011 12:44 pm    Post subject: Finding the root of a binary tree. Reply with quote

I'm using "Memory dissect" tool in Cheat Engine and created a structure representing a node of the tree that I'm trying to find it's root. I typed in the address of a random node I found in the process, then tried to follow the parent of each node (a pointer, located at 0x4) until I find the root (a node that has no parent).
Couldn't find any node that has no parent, instead I got into a loop:

The parent of node 0786FD00 is 0894ADB0 and the parent of node 0894ADB0 is 0786FD00.
Is it a tree with multiple roots? (never heard of such, only a guess)

Update: the solution is reading all possible root nodes (0786FD00 and 0894ADB0 in this case) using preorder method (described here: http://en.wikipedia.org/wiki/Tree_traversal) then choosing the node that returned the highest amount of nodes and searching a pointer for it. That pointer will always point to the root node of the tree.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites