Write a Java program that inputs size of array N and N numbers in the array. It should use Selection sort to sort the array and then display it. Then, ask a number X to search in the array. It should use Linear search and then print the result of search. Sample Output: Searching and Sorting Algorithms Enter size of array ?5 Enter 5 numbers: 5.5 8.2 2.4 9.1 3.3 Sorted array: 2.4, 3.3, 5.5, 8.2, 9.1 Enter a number to search ? 8.2 8.2 Found at index 3

icon
Related questions
Question

data structure (java)

Write a Java program that inputs size of array N and N numbers in the array. It should use Selection sort to sort the array and then display it. Then, ask a number X to search in the array. It should use Linear search and then print the
result of search.
Sample Output:
Searching and Sorting Algorithms
Enter size of array ? 5
Enter 5 numbers :
5.5
8.2
2.4
9.1
3.3
Sorted array: 2.4, 3.3, 5.5, 8.2, 9.1
Enter a number to search ? 8.2
8.2 Found at index 3
Transcribed Image Text:Write a Java program that inputs size of array N and N numbers in the array. It should use Selection sort to sort the array and then display it. Then, ask a number X to search in the array. It should use Linear search and then print the result of search. Sample Output: Searching and Sorting Algorithms Enter size of array ? 5 Enter 5 numbers : 5.5 8.2 2.4 9.1 3.3 Sorted array: 2.4, 3.3, 5.5, 8.2, 9.1 Enter a number to search ? 8.2 8.2 Found at index 3
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.