Looking at the AVL code, I'm wondering what order it sorts in.

I'm confused by the following code:

        while (node) {
                res = avl_dirent_hk_cmpf(node, key);
                if (res == 0)
                        return node;
                if (res > 0)
                        node = node->left;
                else
                        node = node->right;
        }

Given that the comparison functions return -1, 0, 1 for <, ==, >, it seems
like it effectively sorts in reverse order.

Is that correct, or am I confused how the tree works...

Frank



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to