google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 searching mcq | searching mcq questions | searching mcq in data structure - 2nd puc computer science

searching mcq | searching mcq questions | searching mcq in data structure

searching mcq,searching mcq questions,searching mcq in data structure,searching mcq with answers pdf,searching mcq with answers,searching mcq pdf,binary search mcq,linear search mcq,searching mcq in python with answers,searching mcq in python with answers pdf,searching mcq in python online test,mcq search with answer,python mcq online test with answers,searching mcq in python with answers for beginners

searching mcq

1. What is the primary goal of searching in computer science?





ANSWER= C) To locate a specific element in a list

2. Which of the following is another name for linear search?





ANSWER= C) Serial search

3. In linear search, how many comparisons are required in the worst case for a list of n elements?





ANSWER= B) n

4. Linear search is most suitable when the list is:





ANSWER= C) Small and unsorted

5. Which loop is used in the linear search algorithm provided in the chapter?





ANSWER= B) while loop

6. In which case will linear search make only one comparison?





ANSWER= D) When the key is the first element

7. In linear search, if the key is not present in the list, the number of comparisons will be:





ANSWER= C) n

8. What is returned by the linearSearch() function if the key is not found?





ANSWER= C) None

9. Binary search works only on:





ANSWER= C) Sorted lists

10. What is the mid index calculated as in the binary search algorithm?





ANSWER= C) (first + last) // 2

11. In the best case, binary search takes how many iterations to find the key?





ANSWER= B) 1

12. What happens when the middle element in binary search equals the key?





ANSWER= D) The key is found and search terminates

13. What is the time complexity of binary search in the worst case?





ANSWER= C) O(log n)

14. Binary search reduces the list size by:





ANSWER= C) Half each time

15. What is a requirement for the binary search algorithm to work properly?





ANSWER= D) The list must be sorted

16. What does hashing use to calculate the position of an element?





ANSWER= C) Hash function

17. What is the formula for the remainder method used in hashing?





ANSWER= B) element % table size

18. What is the term used when two elements in hashing map to the same index?





ANSWER= C) Collision

19. What is a perfect hash function?





ANSWER= D) A function that maps all elements to unique indices

20. Which search technique is fastest in theory when there are no collisions?





ANSWER= C) Hash-based search

21. Assertion (A): Linear search is suitable for small and unsorted lists. Reason (R): Linear search checks every element sequentially from the beginning of the list.





ANSWER= A) Both A and R are true, and R is the correct explanation of A.

22. Assertion (A): Linear search performs the minimum work when the key is at the end of the list. Reason (R): Linear search stops after finding the first occurrence of the key.





ANSWER= C) A is false, but R is true.

23. Assertion (A): Binary search is faster than linear search on large datasets. Reason (R): Binary search reduces the list size by half in every iteration.





ANSWER= A) Both A and R are true, and R is the correct explanation of A.

24. Assertion (A): Binary search works efficiently on unsorted data. Reason (R): Binary search compares the key only with the first and last elements.





ANSWER= D) Both A and R are false.

25. Assertion (A): In binary search, if the key is not found, the list size continues to reduce until one element remains. Reason (R): Binary search stops only when first > last.





ANSWER= A) Both A and R are true, and R is the correct explanation of A.

26. Assertion (A): Hashing provides constant time search irrespective of the list size. Reason (R): Hashing directly accesses the element by calculating its position using a hash function.





ANSWER= A) Both A and R are true, and R is the correct explanation of A.

27. Assertion (A): A perfect hash function guarantees that no two elements map to the same index. Reason (R): Perfect hash functions are collision-prone.





ANSWER= C) A is true, but R is false.

28. Assertion (A): Binary search modifies the list by deleting elements that are not required. Reason (R): The search area reduces by half in each iteration.





ANSWER= C) A is false, but R is true.

29. Assertion (A): Collisions in hashing occur when two keys are stored at the same index. Reason (R): The modulo division method always avoids collisions.





ANSWER= C) A is true, but R is false.

30. Assertion (A): Binary search is efficient only if the list is sorted. Reason (R): Sorting allows binary search to determine which half to discard.





ANSWER= A) Both A and R are true, and R is the correct explanation of A.

searching mcq | searching mcq questions | searching mcq in data structure searching mcq | searching mcq questions | searching mcq in data structure Reviewed by Vision Academy on July 14, 2025 Rating: 5

No comments:

CheckOut

Powered by Blogger.