Find the diameter of a given binary tree, optimizing for linear time complexity.
Represent each node as [value, left, right], where a missing child is null. Implement binary_tree_diameter(root) and return the diameter as the number of nodes on the longest path between any two nodes. Return 0 for an empty tree. The input tree is not shared or cyclic.
def binary_tree_diameter(root):