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
1. What is the primary goal of searching in computer science?
2. Which of the following is another name for linear search?
3. In linear search, how many comparisons are required in the worst case for a list of n elements?
4. Linear search is most suitable when the list is:
5. Which loop is used in the linear search algorithm provided in the chapter?
6. In which case will linear search make only one comparison?
7. In linear search, if the key is not present in the list, the number of comparisons will be:
8. What is returned by the linearSearch() function if the key is not found?
9. Binary search works only on:
10. What is the mid index calculated as in the binary search algorithm?
11. In the best case, binary search takes how many iterations to find the key?
12. What happens when the middle element in binary search equals the key?
13. What is the time complexity of binary search in the worst case?
14. Binary search reduces the list size by:
15. What is a requirement for the binary search algorithm to work properly?
16. What does hashing use to calculate the position of an element?
17. What is the formula for the remainder method used in hashing?
18. What is the term used when two elements in hashing map to the same index?
19. What is a perfect hash function?
20. Which search technique is fastest in theory when there are no collisions?
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.
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.
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.
24. Assertion (A): Binary search works efficiently on unsorted data. Reason (R): Binary search compares the key only with the first and last elements.
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.
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.
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.
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.
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.
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.

No comments: