Chiganov Aleksey Andreevich M108 Facultet of Space Research MSU SeqJoin 9403
Гаджиев Али Алиевич, ФКИ МГУ, М108 группа SeqJoin 9867
f1def joinseq(*seq):f1def joinseq(*seq):
n2    iterators = [iter(seq_) for seq_ in seq]n2    iterators = [iter(sequence) for sequence in seq]
3    val = [next(i) for i in iterators]3    value = [next(i) for i in iterators]
4    while True:4    while True:
n5        min_item = min(val)n5        min_item = min(value)
6        yield min_item6        yield min_item
t7        idx = val.index(min_item)t7        index = value.index(min_item)
8        val[idx] = next(iterators[idx], None)8        value[index] = next(iterators[index], None)
9        if val[idx] == None:9        if value[index] == None:
10            val.pop(idx)10            value.pop(index)
11            iterators.pop(idx)11            iterators.pop(index)
12            if val == []:12            if value == []:
13                break13                break
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op