college/Spring-2023/CS-2124/Lab-Work-1
2024-02-01 10:46:23 -06:00
..
bin cs-2124(lab): add first lab assignment 2024-02-01 10:46:23 -06:00
src cs-2124(lab): add first lab assignment 2024-02-01 10:46:23 -06:00
CMakeLists.txt cs-2124(lab): add first lab assignment 2024-02-01 10:46:23 -06:00
README.org cs-2124(lab): add first lab assignment 2024-02-01 10:46:23 -06: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