Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 subjective questions Searching techniques

CSE329 — Prelude To Competitive Coding 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Explain the iterative binary search algorithm. Write its pseudocode and derive its time complexity.

  2. Question 2 of 20

    Distinguish between iterative and recursive binary search. Provide the recursive implementation and discuss its space complexity.

  3. Question 3 of 20

    Describe the Jump Search algorithm. Derive the optimal jump (block) size and its time complexity.

  4. Question 4 of 20

    Explain the Sublist Search (search a linked list in another linked list) technique with an algorithm and its time complexity.

  5. Question 5 of 20

    Describe at least three methods to find the missing number in an array containing distinct numbers from the range to . Compare their efficiency.

  6. Question 6 of 20

    Explain how to search an element in a sorted and rotated array in time. Provide the algorithm with an example.

  7. Question 7 of 20

    Write a recursive function to perform substring search (check if a pattern occurs in a text). Explain its working and time complexity.

  8. Question 8 of 20

    Explain the approach to find the K most frequent words from a string. Discuss the data structures used and analyze the complexity.

  9. Question 9 of 20

    Describe how to find a pair with a given difference in an array. Compare the brute-force, sorting, and hashing approaches.

  10. Question 10 of 20

    Define a peak element and explain the algorithm to find a peak element in an array.

  11. Question 11 of 20

    Explain the approach to find the length of the longest subarray having sum in a given range . Discuss the complexity.

  12. Question 12 of 20

    Describe how to print all subarrays with sum in a given range . Provide an algorithm and its complexity.

  13. Question 13 of 20

    Explain the problem of finding the minimum time required to produce items given machines with different production rates. Show how binary search on the answer is applied.

  14. Question 14 of 20

    Compare Linear Search, Binary Search, and Jump Search on the basis of prerequisites, time complexity, and use cases.

  15. Question 15 of 20

    Given the rotated sorted array [7, 8, 9, 1, 2, 3, 4, 5, 6], find the pivot (minimum) element using binary search. Explain each step.

  16. Question 16 of 20

    Derive the recurrence relation for recursive binary search and solve it using the Master Theorem.

  17. Question 17 of 20

    Explain how binary search can find the first and last occurrence of a target element in a sorted array with duplicates.

  18. Question 18 of 20

    A factory has machines with production times [1, 2, 3] and needs to produce items. Compute the minimum time required using the binary search on answer approach, showing each iteration.

  19. Question 19 of 20

    Explain the concept of "binary search on the answer" as a problem-solving pattern in competitive coding. When is it applicable? Give two example problems.

  20. Question 20 of 20

    Distinguish between the sliding window and prefix sum techniques for subarray sum problems. When should each be used?

That's unit 6

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.