[合并多个已经排序的 lists] 多个已经排序过的 lists,将这些 lists 合并并排序 #array
This example demonstrates how to merge multiple pre-sorted lists into a single sorted sequence. It uses Python's `heapq.merge` function, which accepts two sorted lists—here, `a = [1, 4, 7, 10]` and `b = [2, 5, 6, 11]`—and returns a generator yielding items in ascending order. The code then iterates through the generator with a `for` loop, printing each merged value. The key constraint is that `heapq.merge` only works correctly when all input lists are already sorted, as shown in this minimal, console-based illustration.