How would you store an AVL tree?
Implement serialize_avl(root) to encode the tree structure using preorder traversal and None markers for missing children. The input is a nested list [key, left, right], or None for an empty tree. Return a flat list that preserves every key and child relationship, including the empty tree case.
def serialize_avl(root):