, (, ), (, ):
create collection first[] with elements (starttime, duration)
first.append (1, 3)
first.append (2, 4)
first.append (3, 4)
first.append (2, 3)
(starttime, duration) first = [(1,3), (2,4), (3,4), (2,3)].
, , , :
second, first, :
create array second[] with elements (firstindex, endtime)
for each index in first.indexes:
second.append (index, first[index].starttime + first[index].duration)
(firstindex, endtime) tuples second = [(1,4), (2,6), (3,7), (4,5)] ( , , ).
second , second = [(1,4), (4,5), (2,6), (3,7)].
:
for each index in second.indexes:
output "task # ", second[index].firstindex
output " starts at, " first[second[index].firstindex].starttime
output " duration, " first[second[index].firstindex].duration
output " ends at ", second[index].endtime, new-line
:
task
task
task
task