From: Kenneth Kalmer Date: 2007-07-24T22:27:27+09:00 Subject: Re: Large binary trees & stack level too deep On 7/23/07, Lloyd Linklater wrote: > Kenneth Kalmer wrote: > > > > > This raises the question, is a binary tree right for sorting such high > > volumes of information? > > > > I plan to release the final product as FOSS, so if anyone wants a > > Please refrain from giving explicit code examples, this is a personal > > challenge for myself and I'm looking for guidance. > > Well, if a binary tree gets too large and it is being called > recursively, then you really do need to make sure that you do not blow > your stack. Thinking back to old school ways of handling such things, > this is more of a coding approach rather than Ruby specific advice here, > you might consider using databases. If you set it up so that each > branch references the ways that you can go on the tree, you can then > walk the tree iteratively rather than recursively. > > Just a thought. Thanks Lloyd Part of the exercise for me was exploring the possibility of using a complete memory based solution as opposed to touching ad database. But it seems you've got a point, I'll compare using in-memory hashtables and MySQL/sqlite3 to see how it pans out. Best -- Kenneth Kalmer kenneth.kalmer@gmail.com Folding@home stats http://fah-web.stanford.edu/cgi-bin/main.py?qtype=userpage&username=kenneth%2Ekalmer