Please answer all questions and read carefully
This tutorial consists with 3 questions. Try to complete this tutorial by commit your changes and read the questions carefully 😄
Given an array arr[]={10, 20, 80, 30, 60, 50, 110, 100, 130, 170}, write a C program to search value 110 in unsorted arr[].
Input:
arr[] = {10, 20, 80, 30, 60, 50, 110, 100, 130, 170}
Output:
Element with value 110 is present at index 6
Given an array arr[]={10, 20, 80, 30, 60, 50, 110, 100, 130, 170}, write a C program to search value 200 in unsorted arr[].
Input:
arr[] = {10, 20, 80, 30, 60, 50, 110, 100, 130, 170}
Output:
Element with value 200 is not present in arr[]
Given an array arr[]={10, 20, 30, 40, 50, 60, 70}, write a C program to search value 45 in sorted arr[] (Note: use technique sequential search for sorted list/array)
Input:
arr[] = {10, 20, 30, 40, 50, 60, 70}
Output:
Element with value 45 is not present in arr[]
Given an array arr[]={10, 20, 30, 40, 50, 60, 70}, write a C program to search value 50 in sorted arr[] (Note: use technique sequential search for sorted list/array)
Input:
arr[] = {10, 20, 30, 40, 50, 60, 70}
Output:
Element with value 50 is present at index 4
Given an array arr[]={10, 20, 30, 40, 50, 60, 70}, write a C program to search value 50 in sorted arr[] (Note: use technique binary search for sorted list/array)
Input:
arr[] = {10, 20, 30, 40, 50, 60, 70}
Output:
Element with value 50 is present at index 4
Given an array arr[]={10, 20, 30, 40, 50, 60, 70}, write a C program to search value 45 in sorted arr[] (Note: use technique binary search for sorted list/array)
Input:
arr[] = {10, 20, 30, 40, 50, 60, 70}
Output:
Element with value 45 is not present in arr[]