Question: AT&T LTE 1:07 PM @ 20% cosc241-L3-searchSort.d . Implement the MySort class with the following operations. a bubbleSort(MyVector vec) -conduct bubble sort on the elements
AT&T LTE 1:07 PM @ 20% cosc241-L3-searchSort.d . Implement the MySort class with the following operations. a bubbleSort(MyVector vec) -conduct bubble sort on the elements contained in a MyVector object. b. selectionSort(MyVector vec)-conduct selection sort on the elements contained in a MyVector object. Implement the MySearch class with the following binarySearch(My conduct binary search on sorted elements contained in a MyVector object. Vector vec, Comparable target) b. linearSearchSorted (MyVector vec, Comparable target) - conduct linear search on sorted elements contained in a MyVector object. Both the MySearch and MySort classes should be created in the collection package. After implementing the MySearch and My Sort classes you will test them. To test the MySearch and MySort classes you will create a Lab3 class under the lab package. s. In the Lab3 class you will create an static void testO method. In this test method you will do the following: a Create a nmiec of MyVector type. b. Generate a sequence of 121 integer numbers in the range [100, 999] using java.util.Random with current system time as the random seed (use java lang.System.nanoTime)). Insert this sequence of numbers into numVec one by one when it is being c Sort num Vec using bubblesort. d Print out numVec onto the screen. e Prompt user to type in a number through keyboard. t Search that number using linearSearchSorted, and print out the returned value onto screen. CallumVec.removeRange(2, 22) h. Then call numVec.reverse). Sort numVec using selectionSort j Print out numVec onto the screen. k. Prompt user to type in a number through keyboard. . Search that number using binarySearch, and print out the returned value onto screen. 6 Under the main package, in the Main class, remove (or comment it out) the contents of the main method we have Dashboard Calendar ToDo Notifications Inbox AT&T LTE 1:07 PM @ 20% cosc241-L3-searchSort.d . Implement the MySort class with the following operations. a bubbleSort(MyVector vec) -conduct bubble sort on the elements contained in a MyVector object. b. selectionSort(MyVector vec)-conduct selection sort on the elements contained in a MyVector object. Implement the MySearch class with the following binarySearch(My conduct binary search on sorted elements contained in a MyVector object. Vector vec, Comparable target) b. linearSearchSorted (MyVector vec, Comparable target) - conduct linear search on sorted elements contained in a MyVector object. Both the MySearch and MySort classes should be created in the collection package. After implementing the MySearch and My Sort classes you will test them. To test the MySearch and MySort classes you will create a Lab3 class under the lab package. s. In the Lab3 class you will create an static void testO method. In this test method you will do the following: a Create a nmiec of MyVector type. b. Generate a sequence of 121 integer numbers in the range [100, 999] using java.util.Random with current system time as the random seed (use java lang.System.nanoTime)). Insert this sequence of numbers into numVec one by one when it is being c Sort num Vec using bubblesort. d Print out numVec onto the screen. e Prompt user to type in a number through keyboard. t Search that number using linearSearchSorted, and print out the returned value onto screen. CallumVec.removeRange(2, 22) h. Then call numVec.reverse). Sort numVec using selectionSort j Print out numVec onto the screen. k. Prompt user to type in a number through keyboard. . Search that number using binarySearch, and print out the returned value onto screen. 6 Under the main package, in the Main class, remove (or comment it out) the contents of the main method we have Dashboard Calendar ToDo Notifications Inbox
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
