Skip to content

ArrayList algorithms: filter and the remove bug · ⁨ArrayList 算法:筛选与删除的 bug⁩

English

Doing work on a whole list

  • Now you can store data in an ArrayList. Next we process it.
  • Common jobs: count items that match a rule, filter them into a new list, and remove some of them.
  • All of these use a loop over the list.
中文

对整个列表进行处理

  • 现在你会把数据存进 ArrayList 了。接下来我们处理(process)它。
  • 常见的工作:统计(count)符合规则的元素、把它们筛选(filter)到一个新列表里、以及删除(remove)其中一些。
  • 这些都用一个遍历列表的循环来完成。

Handout

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩