dancefloorlandmine: (Greenscreen)
dancefloorlandmine ([personal profile] dancefloorlandmine) wrote2004-03-28 08:19 pm

[MSc] Aaaaagh!

I hate binary search trees and sodding recursive sodding functions. That is all. Nothing else to see here.

Nooooooo!

[identity profile] gaxx.livejournal.com 2004-03-28 02:18 pm (UTC)(link)
Recursion is good :)

We like recursion :)

Re: Nooooooo!

[identity profile] d-floorlandmine.livejournal.com 2004-03-28 02:27 pm (UTC)(link)
OK, I'm willing to allow that recursion is good - but only now I've managed to get this fragment working ... [grin]

Final piece of coursework for this term, and it features a binary search tree where each node has two pairs of pointers, as the tree is linked in two ways. Have to build the tree, output contents in both orders, and then search it. I was having some trouble with it, although I knew (in fairly non-specific terms) what I wanted it to do. Went back to basics, and built a working single tree. Then upgraded that into a working doubletree, and now converting the main() from that code into a class definition, so that the final code has a nice simple main function, which merely provides the filename for the data source and calls the output functions and the search function.

Inputs include an interesting mix of fstreams and cin/cout, as they use automated results testing, which AFAIK uses overloaded cin/cout to simulate the user input.

The downside is I'm almost out of dips.

[identity profile] medains.livejournal.com 2004-03-29 01:08 am (UTC)(link)
Hooray for complex data structures.

Hooray for recursive functions.

:P