void main() {
List data = [5,4,2,7,8,3];
List sortedData = [];
while (data.isNotEmpty)
{
// pop out the first element
int tmp = data.removeLast();
// while temporary stack is not empty and top
// of stack is greater than temp
while (sortedData.isNotEmpty && sortedData[sortedData.length - 1] > tmp)
{
// pop from temporary stack and push
// it to the input stack
data.addAll(sortedData.removeLast());
}
// push temp in tempory of stack
sortedData.add(tmp);
}
print(data);
print(sortedData);
}
Uncaught Error: TypeError: 8: тип 'JSInt' не является подтипом типа 'Iterable'
Что я здесь не так делаю?