Skip to content

Searching: linear and binary · ⁨查找:线性与二分⁩

English

Two ways to search

  • Searching means finding where a value is in an array (or saying it is not there).
  • Linear search checks every item one by one. It works on any array.
  • Binary search is much faster but needs the array to be sorted first.
中文

两种查找方法

  • 查找就是找出某个值在数组里的位置(或者说它不在)。
  • 线性查找一个一个地检查每个元素。它对任何数组都有效。
  • 二分查找快得多,但需要数组先排好序。

Handout

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

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