CUET Computer/IP: Computer ScienceSearching. Free, no login required.

Q1:

2025: 27 May Shift 2

Searching

Medium

Computer Science

Which of the following features with respect to Binary Search algorithm are correct?

(A) List should be arranged in either an ascending or descending order of their key values.

(B) The key to be searched is compared with the element in the middle of a sorted list.

(C) If the middle element is greater than or less than the key, it means that the key is present in either half of the list and repeats the process in the halfs.

(D) The key to be searched is compared with the first element of the sorted list.

Answer options
Option 1
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 1

Q2:

2025: 27 May Shift 2

Searching

Easy

Computer Science

Consiser the following linear list 'L':

L=[11,32,17,19,23,29,42]

Determine the number of comparisons a linear search will take to search for key 42.

Answer options
Option 4
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 2

Q3:

2025: 22 May Shift 1

Searching

Easy

Computer Science

In the given list=[-4, 0, 2, 7, 8, 17, 19]. Determine the number of iterations required to find element 7 using binary search.

Answer options
Option 1
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 3

Q4:

2025: 22 May Shift 1

Searching

Medium

Computer Science

Outline the steps for inserting an element using a Hash function-

(A) Apply the hash function to compute the index.

(B) Insert the element at the computed index in the hash table.

(C) Check the collision and resolve if any.

(D) Initialize the hash table.

Answer options
Option 1
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 4

Q5:

2025: 22 May Shift 1

Searching

Easy

Computer Science

The ________ takes elements of the list one by one and generates an index value for every element.

Answer options
Option 1
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 5

Q6:

2025: 21 May Shift 1

Searching

Easy

Computer Science

For which of the following cases, binary search is not suitable?

Answer options
Option 1
Correct Answer
Explanation for 2025: 21 May Shift 1 CSE question 6

Q7:

2025: 21 May Shift 1

Searching

Easy

Computer Science

When an element to be searched is present at one of the following positions in an unsorted list, then which situation(s) will take the least number of comparisons?

(A). mid position

(B). first position

(C). last position

(D). not present

Answer options
Option 3
Correct Answer
Explanation for 2025: 21 May Shift 1 CSE question 7

Q8:

2025: 21 May Shift 1

Searching

Easy

Computer Science

Consider the following list=[7, 9, 5, 16, 2, 8, -11]. How many comparisons will be required to find element 20 from this list using the linear search algorithm?

Answer options
Option 2
Correct Answer
Explanation for 2025: 21 May Shift 1 CSE question 8

Q9:

2025: 21 May Shift 1

Searching

Easy

Computer Science

Consider the list= [34, 16, 2, 26, 80]

If the hash function is given by ([i] % 10), which of the elements will create a collision situation?

Answer options
Option 1
Correct Answer
Explanation for 2025: 21 May Shift 1 CSE question 9

Q10:

2025: 20 May Shift 1

Searching

Easy

Computer Science

In Hashing, if every item of the list maps to a unique index in the hash table, the hash function is called as _______________ .

Answer options

Q11:

2025: 20 May Shift 1

Searching

Easy

Computer Science

Given a list 'numList' of 'n' elements and the key value 'K'. Arrange the following steps in linear search algorithm 'LinearSearch(numList, key, n)' to find the position of the key 'K' in 'numList':

(A) PRINT “Search unsuccessful”

(B) WHILE index < n, REPEAT Step 3

(C) SET index = 0

(D) IF numlist[index]= key THEN

PRINT “Element found at position”, index+1

STOP

ELSE

index = index+1

Answer options

Q12:

2025: 16 May Shift 1

Searching

Easy

Computer Science

How many comparisons will be required by a linear search algorithm, if the element being searched is not present in the list of n elements?

Answer options

Q13:

2025: 16 May Shift 1

Searching

Easy

Computer Science

The time complexity of Hashing is :-

Answer options

Q14:

2025: 16 May Shift 1

Searching

Easy

Computer Science

The best case of a binary search is when, ______________ .

Answer options

Q15:

2025: 15 May Shift 2

Searching

Easy

Computer Science

What does HASHING function do?

Answer options

Q16:

2025: 15 May Shift 2

Searching

Easy

Computer Science

Find the condition that holds FALSE for binary search:

Answer options

Q17:

2025: 15 May Shift 2

Searching

Easy

Computer Science

Given a list:

L = [8, -4, 7, 17, 0, 2, 19]

Find the number of comparisons to locate value 7 in the list using Linear Search.

Answer options

Q18:

2025: 14 May Shift 1

Searching

Easy

Computer Science

The technique which is used to know the presence of an element in the list in just one step is called___________.

Answer options

Q19:

2025: 14 May Shift 1

Searching

Easy

Computer Science

What is the time complexity of linear search when the element is present at the first position of the list with 'n' elements?

Answer options

Q20:

2025: 14 May Shift 1

Searching

Medium

Computer Science

Consider the sorted list of 15 elements:-

list = [2, 3, 5, 7, 10, 11, 12, 17, 19, 23, 29, 31, 37, 41, 43]

We need to search for element 2 in this list. What will be the order of the elements found at MID position in the first four iterations of binary search?

(A) 2

(B) 3

(C) 17

(D) 7

Answer options

Q21:

2025: 13 May Shift 2

Searching

Easy

Computer Science

In binary search after every pass of the algorithm, the search area:

Answer options

Q22:

2025: 13 May Shift 2

Searching

Medium

Computer Science

Given a list numList of n elements and key value K, arrange the following steps for finding the position of the key K in the numList using binary search algorithm i.e. BinarySearch(numList, key)

(A) Calculate mid = (first+last)//2

(B) SET first = 0, last = n-1

(C) PRINT “Search unsuccessful”

(D) WHILE first <= last REPEAT

IF numList[mid] = key

PRINT “Element found at position”, mid+1

STOP

ELSE

IF numList[mid] > key, THEN last = mid-1

ELSE first = mid + 1

Answer options

Q23:

2025: 13 May Shift 2

Searching

Easy

Computer Science

For binary search, the list is in ascending order and the key is present in the list. If the middle element is less than the key, it means:

Answer options