Олег Алексеевич Бугай, ФКИ, группа 108м SeqJoin 9920
Chiganov Aleksey Andreevich M108 Facultet of Space Research MSU SeqJoin 9403
f1def joinseq(*seq):f1def joinseq(*seq):
n2    it = [iter(s) for s in seq]n2    iterators = [iter(seq_) for seq_ in seq]
3    v = [next(k) for k in it]3    val = [next(i) for i in iterators]
4    while True:4    while True:
t5        m_it = min(v)t5        min_item = min(val)
6        yield m_it6        yield min_item
7        i = v.index(m_it)7        idx = val.index(min_item)
8        v[i] = next(it[i], None)8        val[idx] = next(iterators[idx], None)
9        if v[i] == None:9        if val[idx] == None:
10            v.pop(i)10            val.pop(idx)
11            it.pop(i)11            iterators.pop(idx)
12            if v == []:12            if val == []:
13                break13                break
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op