Talk:AVL tree

Revision as of 16:40, 31 May 2014 by rosettacode>Dkf (Respond to issues)

Here nor there

I coded the Go solution from code at http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx. There is complete working code there in C, it's public domain, and I found it relatively easy to port. (I found this site from a comment in Chromium source that said they used it.) The tutorial claimed that the version was relatively compact, as AVL code goes, which seemed good for RC, especially since AVL trees are a little on the complex side as RC tasks go. I resisted the urge to compact or optimize the code more, which certainly could be done. —Sonia (talk) 22:39, 22 May 2014 (UTC)

As long as the copyright issues aren't going to bite us, that won't be a problem. I advise not heavily optimising the code, unless it also makes the code easier to understand as a general programmer (of Go, of course; don't worry too much about general programmers of some other random language). We don't aim for optimal solutions here precisely because they tend to be so hard to read, understand and compare. (We also can't compare performance between languages; matching hardware and language implementation optimisation levels is utterly impossible between different developers' systems. Let some other site worry about that.) –Donal Fellows (talk) 16:40, 31 May 2014 (UTC)

Basic operations

The Go code I'm posting today just implements the operations in the original C, an insert allowing multiple keys and a delete that returns no status. Should the task be more specific than “basic operations?” In particular there is no find in my code. Find first, find last, find previous, find next, other flavors of insert and delete might be interesting. Wikipedia mentions find previous and find next as interesting. —Sonia (talk) 22:39, 22 May 2014 (UTC)

The minimum operations have got to be insert and lookup, but remove and print (of the tree) are a good idea too. In fact, for an RC task I'd say that print is vital. –Donal Fellows (talk) 16:40, 31 May 2014 (UTC)

Completing the task description

The task should say what basic operations to implement and say to demonstrate them somehow. Demonstrate each operation should be a minimum, but it might be nice to specify some data to insert, delete, and so on, as a way of assessing correct results. —Sonia (talk) 22:39, 22 May 2014 (UTC)

Have a care, as that can easily invalidate other people's solutions, which can make them a little grouchy. Or at least it does so to me. ;-) –Donal Fellows (talk) 16:40, 31 May 2014 (UTC)
Return to "AVL tree" page.