Question: NEED ASAP. JAVA PROGRAM Question 4 Write a recursive method replaceAll in the class RecStuff which will replace all occurrences of an old word with
NEED ASAP. JAVA PROGRAM
Question 4
Write a recursive method replaceAll in the class RecStuff which will replace all occurrences of an old word with a new word in all files with the suffix .txt in a given directory and in sub-directories of that directory (You are changing file contents). The signature for this method is as follows: public static void replaceAll(String sPath, String sOldWord, String sNewWord)
Question 5
Merge sort is very efficient for working with large arrays but is not as efficient as Bubble sort when working with smaller arrays. In the class RecStuff write a modified form of merge sort (for ints) that will invoke a bubble sort if the current array size being worked with is less than 80. If the size is over 80 continue with the regular Merge sort code. Include all required methods in the class RecStuff. Test your modified merge sort on random int arrays of size 10,000, 100,000 and 1,000,000 using System.nanotime to estimate execution times. Does the new merge sort seem to be more efficient? Place your observations in the Javadoc header for your modified mergeSort.
Need help coming up with a code! Thank you :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
