college/Spring-2024/CS-2124/Lab-Work-1
2024-05-12 01:18:21 -05:00
..
bin Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00
src Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00
CMakeLists.txt Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00
README.org Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00

Lab Work - Sorting and Binary Search

Get an array of integer, the target integer, then sort the array and find the target using binary search

  • Create a library for binary search and a sorting algorithm to sort the array and use it in main file
  • Input:

    • First line contains one integer $n$, the size of the array
    • Second line contains $n$ integers $a_i$, elements of the array
    • Third line contains the search integer/key $m$
  • Output:

    • Print the location of the search integer $m$ in the given array. If not found, print -1.

Submit the zipped folder