Computer Science - 9210 OxfordAQA

Searching Algorithms

Akopọ

You have lost your passport somewhere in the house. One way to find it is to start in the hall and search every room in turn until you hit it. The other way, if the house is a hotel with numbered rooms and you know the number, is to walk to the middle corridor, see whether your room is above or below, and ignore half the building. Both plans find the passport. Only one of them is any use in a hotel with a thousand rooms.

Those two plans are the linear search and the binary search, and this specification wants three things from you: the mechanics of each, the ability to follow and write pseudocode for both, and a clear-eyed comparison of where each one wins. The comparison is not simply that binary is faster. Binary search demands something in return, and knowing what it demands is the difference between a two-mark answer and a four-mark one.

Awọn Afojusun

  1. Understand and explain how the linear search algorithm works.
  2. Understand and explain how the binary search algorithm works.
  3. Compare and contrast linear and binary search algorithms.

Àwòrán ọpọlọ

A ti ṣe àwòrán kókó yìí kí o lè rí bí àwọn èrò ṣe so pọ̀.

Ṣí àwòrán ọpọlọ nínú áàpù

Akọ̀wé Ẹ̀kọ́

A search algorithm answers a question of the form: is this value in this collection, and if so, where? The answer usually comes back as a position, and by convention an impossible position such as -1 means the value was not there at all. Almost every program you use runs thousands of searches a second, and the specification requires two of them by name: the linear search and the binary search.

Àkọsílẹ̀ Ẹ̀kọ́ Pípé wà lórí Ohun Èlò Green Bridge

Gba ohun èlò Green Bridge CBT sórí fóònù tàbí kọ̀mpútà rẹ fún gbogbo ilé ìkàwé IGCSE: ìwé ìdánwò àtijọ́, ìlànà ìdíwọ̀n, àwòrán èrò, káàdì ìkẹ́kọ̀ọ́ àti ẹ̀kọ́ ohùn.

Awọn akọsilẹ ẹkọ ni kikun pẹlu awọn aworan apejuwe
Oluranlọwọ ẹkọ ti AI ṣe agbara rẹ
Ìdánwò àdáṣe onítọ̀kọ̀ tí a ń ṣàyẹ̀wò lẹ́sẹ̀kẹsẹ̀ tí o bá parí
O wa lori Android, Windows, macOS, ati Linux Áàpù iOS ń bọ̀ láìpẹ́

Ìdánwò Ẹ̀kọ́

Oriire fun ipari ẹkọ lori Searching Algorithms. Ni bayi ti o ti ṣawari naa awọn imọran bọtini ati awọn imọran, o to akoko lati fi imọ rẹ si idanwo. Ẹka yii nfunni ni ọpọlọpọ awọn adaṣe awọn ibeere ti a ṣe lati fun oye rẹ lokun ati ṣe iranlọwọ fun ọ lati ṣe iwọn oye ohun elo naa.

Iwọ yoo pade adalu awọn iru ibeere, pẹlu awọn ibeere olumulo pupọ, awọn ibeere idahun kukuru, ati awọn ibeere iwe kikọ. Gbogbo ibeere kọọkan ni a ṣe pẹlu iṣaro lati ṣe ayẹwo awọn ẹya oriṣiriṣi ti imọ rẹ ati awọn ogbon ironu pataki.

Lo ise abala yii gege bi anfaani lati mu oye re lori koko-ọrọ naa lagbara ati lati ṣe idanimọ eyikeyi agbegbe ti o le nilo afikun ikẹkọ. Maṣe jẹ ki awọn italaya eyikeyi ti o ba pade da ọ lójú; dipo, wo wọn gẹgẹ bi awọn anfaani fun idagbasoke ati ilọsiwaju.

  1. Which condition must be met before a binary search can be used? A. The data must be stored in a file B. The data must be numeric C. The data must be sorted D. The data must contain no duplicates Answer: C
  2. An array holds 64 sorted items. What is the maximum number of comparisons a binary search will make? A. 6 B. 8 C. 32 D. 64 Answer: A
  3. A linear search is used on an array of 40 items to look for a value that is not present. How many comparisons are made? A. 1 B. 20 C. 39 D. 40 Answer: D
  4. In an iterative binary search, which assignment is made when the middle element is smaller than the target? A. First becomes Middle B. First becomes Middle + 1 C. Last becomes Middle D. Last becomes Middle - 1 Answer: B
  5. Which of the following is an advantage of a linear search over a binary search? A. It makes fewer comparisons on large data sets B. It works on data that is not in any order C. It halves the search area at each step D. It can only be used on arrays Answer: B

Ṣiṣẹ́ lórí àwọn ìbéèrè wọ̀nyí nínú ohun èlò náà

Ṣiṣẹ́ lórí àwọn ìbéèrè wọ̀nyí nínú ohun èlò náà

Ṣe Adaṣe Awọn Ibeere Idanwo Adaṣe

Ṣe o fẹ ṣe adaṣe awọn ibeere idanwo adaṣe nipa Searching Algorithms? Ṣe igbasilẹ ohun elo Green Bridge CBT lati wọle si awọn ibeere idanwo adaṣe ati awọn ayẹwo adaṣe kikun fun koko-ọrọ yii.

Ṣe igbasilẹ ohun elo naa lori Google Playstore

Gbogbo ohun ti o nilo lati ṣe dara julọ ninu JAMB, WAEC ati NECO.

Green Bridge CBT Mobile App
Asiko ẹkọ AI ti ara ẹni Chat Assistant
Ìbéèrè ìdánwò IGCSE, JAMB, WAEC ati NECO tó ju 200,000 lọ
Fiwọn 1200 Awọn akọsilẹ Ẹkọ ju.
Atilẹyin Aisinipo - Kọ ẹkọ Nigbakugba, Nibi gbogbo
Tẹ̀dí Green Bridge
Àkójọpọ̀ Ìtàn Lítíréṣọ̀ & Ìbéèrè Tó Lè Dáyéé ṣẹ́lẹ̀
Tẹle iṣẹ ṣiṣe rẹ ati ilọsiwaju rẹ.
Àlàyé tí ó jinlẹ̀ fún ìmòye tó jinlẹ̀.