Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Searching: linear and binary · ⁨การค้นหา: Linear และ 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.
ไทย

วิธีการค้นหาสองแบบ

  • การค้นหา หมายความว่าหาว่าค่าอยู่ที่ไหนในอาร์เรย์ (หรือบอกว่าไม่มีอยู่)
  • Linear search ตรวจสอบทุกรายการทีละตัว ใช้งานได้กับอาร์เรย์ทุกชนิด
  • Binary search เร็วกว่ามากแต่ต้องการให้-array被 sorted ก่อน

Handout · ⁨เอกสารประกอบการเรียน⁩

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP