July 2025

S M T W T F S
  12345
6789101112
13141516171819
202122232425 26
2728293031  

Style Credit

Expand Cut Tags

No cut tags
Sunday, March 28th, 2004 08:19 pm
I hate binary search trees and sodding recursive sodding functions. That is all. Nothing else to see here.
Sunday, March 28th, 2004 02:18 pm (UTC)
Recursion is good :)

We like recursion :)
Sunday, March 28th, 2004 02:27 pm (UTC)
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.
Monday, March 29th, 2004 01:08 am (UTC)
Hooray for complex data structures.

Hooray for recursive functions.

:P