wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AL_lecture_search_algorithm

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

Binarysearch algoritmi qanday arraydan qidiradi

a)

tartiblangan

b)

Tartiblanmagan

2.

How does a binary search algorithm works?​

a)

Dividing the list into halves until the item is matched with one in the list.​

b)

Starts with the first element and checks the next element consecutively until a match is found.

c)

​ None of the above​

3.

An array with 32 elements is input to a binary search algorithm. How many maximum number of comparisons are performed?​

a)

32

b)

16

c)

8

d)

5

4.

An array with 32 elements is input to a linear search algorithm. How many maximum number of comparisons are performed?​

a)

32

b)

16

c)

8

d)

5

5.

How is the midpoint of the list calculated?​

a)

midpoint= round ((first_element+last_element)/2)​

b)

midpoint=(lower_bound+upper_bound)/2​

c)

midpoint= round ((lower_bound+upper_bound)/2)​

d)

midpoint= round ((lower_bound+upper_bound))

6.

What is the disadvantage of binary search algorithm?​

a)

It takes longer time when compared to linear search algorithm​

b)

It works only on sorted lists​

c)

It is very complex to understand​

7.

What is the worst-case runtime of lookUp/get in a binary search tree?

a)

O(n)

b)

O(logn)

c)

O(1)

d)

O(n2)

8.

Chiziqli va binary search qay biri tez ishlaydi

a)

binary

b)

chiziqli

c)

teng

9.

Binary search algoritmi vaqt murakkabligi

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

10.

chiziqli qidirish algoritmi vaqt murakkabligi

a)

O(n^2)

b)

O(n)

c)

O(log n)

d)

O(1)

11.

Sodda qidirish algoritmini ko`rsating

a)

binary

b)

chiziqli

c)

ikkitasi ham

12.

binary qidirish algoritmi ishlash g’oyasi.........

b)

ikkiga bo`lish va qidirish

c)

navbat bilan qidirib borish

d)

Sakrab qidirish

13.

Chiziqli qidirish algoritmi ishlash g’oyasi.........

b)

ikkiga bo`lish va qidirish

c)

navbat bilan qidirib borish

d)

Sakrab qidirish