stdin:首行 N L;次行 N 个整数依次插入 BST(重复忽略)。根为第 0 层。打印第 L 层任意两值的最小绝对差;该层不足 2 个值则打印 0。
Single-file C (gcc -O0 -Wall). Self-contained reframing of the exam's ADT-completion question. From COMP2521 24T2 Sample.
stdin:首行 N L;次行 N 个整数依次插入 BST(重复忽略)。根为第 0 层。打印第 L 层任意两值的最小绝对差;该层不足 2 个值则打印 0。
Single-file C (gcc -O0 -Wall). Self-contained reframing of the exam's ADT-completion question. From COMP2521 24T2 Sample.