pub unsafe fn avl_tree_convert_to_list(root: &mut AVLRoot) -> AVLNodePtr {
    if root.node.is_null() {
        return ptr::null_mut();
    }
    let mut node = root.node.first_node();
    let head = node;
    root.node = ptr::null_mut();
    while node.not_null() {
        let next = node.next();
        node.set_right(next);
        node = next;
    }
    head
}
/// convert AVL to list
/// left become prev
/// right become next
convert AVL to list
left become prev
right become next
convert AVL to list left become prev right become next
pub unsafe fn avl_tree_convert_to_list(root: &mut AVLRoot) -> AVLNodePtr {
    if root.node.is_null() {
        return ptr::null_mut();
    }
    let mut node = root.node.first_node();
    let head = node;
    root.node = ptr::null_mut();
    while node.not_null() {
        let next = node.next();
        node.set_right(next);
        node = next;
    }
    head
}
pub unsafe fn avl_tree_convert_to_list ( root : & mut AVLRoot ) -> AVLNodePtr { if root . node . is_null ( ) { return ptr :: null_mut ( ) ; } let mut node = root . node . first_node ( ) ; let head = node ; root . node = ptr :: null_mut ( ) ; while node . not_null ( ) { let next = node . next ( ) ; node . set_right ( next ) ; node = next ; } head }
convert AVL to list
left become prev
right become next
convert AVL to list left become prev right become next
root
&mut AVLRoot