Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Корзина = Новый Массив;
Корзина.Добавить("ручка");
Корзина.Добавить("тетрадь");
Корзина.Добавить("ластик");
Корзина.Удалить(Корзина.Найти("тетрадь"));
Корзина.Вставить(0, "клей");
Сообщить(Корзина[1]);
Сообщить(Корзина.Найти("тетрадь") = Неопределено);ручка Да
- Expecting
Вставитьto replace the element at the index: it inserts a new one and shifts the rest right - Comparing the result of
Найтиwith-1, as in other languages: a missing value givesНеопределено
- Why does deleting elements in a forward
Дляloop run past the end? - How do you clear the whole array in one call?