Quote (Eep @ 21 Nov 2012 18:36)
So for my latest project I have a class which contains 3 pointers - one to a spouse, one to sibling(s) and one to kid(s)
I need a function to search through ALL OF THESE (they are not ordered) and return a pointer to the one which contains a certain string (their name)
I can not for the LIFE OF ME figure out a function to do this with because of the funky way the class is set up and what not.
Can anyone offer some suggestions??
Well get a recursive call where you send the child of the current node, but before calling the recursive check for equality with those you have acces at the very moment. Why do you get to have a 3 branch tree unordered? You should maybe consider AVL with Parent - RightChild, LeftChild, way simpler.