I don't know if this is a valid thought. But since nobody else is saying anything.... How about viewing it as a linked list, only with multiple next pointers? this way you can begin with a foreach(friend->friend) search. before moving to a foreach(friend->friend->friend) search. If you structured the program correctly it would follow efficency of code and be only subject to the effency of the search algorithm you used.
No comments:
Post a Comment