Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Range query over binary search tree?

Name: Anonymous 2008-09-09 8:01

Okay, so does anyone know or can think of an efficient way to complete a range query over a given number range ie (x, y) in a standard binary search tree, using a minimum number of key comparisons? I wrote one that finds the minimum value <= x and then traverses the tree value by value until it finds a value that is above y, but I just realised that it would be a lot more efficient if it was recursive, and did not provide the range query's response in a sorted order.

Unfortunately, I have writer's block. Still getting used to getting my head in algorithm-space. Can anyone give me some pointers to get me started?

Name: Anonymous 2008-09-12 8:16

>>33
if there's a syntax error it's not going to really do anything at all after that except print out potentially misleading error messages as it tries to incorrectly parse the rest of the code.
i don't think having over 9000 error messages (i've had this happen when compiling a certain open-source application, how the fuck can anyone be stupid enough to put 15000 lines of code in one file?) scroll the original error out of my terminal buffer is very useful.

>>34
you can't recompile something that you haven't compiled yet.
if there's a syntax error and the compiler still claims to have succeeded in compiling the file, something is very wrong.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List