Two new routines, compare_node_index and compare_node_priority routines, can be used by qsort depending on sort_order var