Respuesta :
The solution to the questions are:
- The list elements that will be compared to the key using binary search are 9, 30, 33, 44
- The list elements that will be compared to the key using linear search are 9
- The list elements that will be compared to the key using binary search are 44
- The list elements that will be compared to the key using linear search are 9, 30, 33, 44
How to determine the list elements
9 using binary search?
The list is given as:
9, 30, 33, 44, 56, 77, 87, 98
In binary search, the list starts from the middle element.
Here, the middle element is at the position
Middle = N/2
This gives
Middle = 8/2
Middle = 4
The fourth element is 44.
9 is less than 44.
So, the list elements that will be compared to the key using binary search are 9, 30, 33, 44
9 using linear search?
The list is given as:
9, 30, 33, 44, 56, 77, 87, 98
Here, the search begins from the start.
The number 9 is at the beginning.
So, the list elements that will be compared to the key using linear search are 9
44 using binary search?
The list is given as:
9, 30, 33, 44, 56, 77, 87, 98
In binary search, the list starts from the middle element.
Here, the middle element is at the position
Middle = N/2
This gives
Middle = 8/2
Middle = 4
The fourth element is 44.
44 equals 44.
So, the list elements that will be compared to the key using binary search are 44
44 using linear search?
The list is given as:
9, 30, 33, 44, 56, 77, 87, 98
Here, the search begins from the start.
The number 44 is at the fourth position.
So, the list elements that will be compared to the key using linear search are 9, 30, 33, 44
Read more about binary and linear search at:
https://brainly.com/question/15190740
#SPJ1