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