Question: Please help me code the following in: JAVA! Please read the instructions THOROUGHLY and use many COMMENTS! Full points will be awarded, thanks in advance!
Please help me code the following in: JAVA!
Please read the instructions THOROUGHLY and use many COMMENTS!
Full points will be awarded, thanks in advance!


Notes:
-One of the subprograms you write will create a stack overflow. Hint: This is why it says "attempt" and "report on the results" in the assignment description.
-At a minimum, there should be two files named FindFile.java and Driver.java. Thus, I am assuming your file search driver program is named Driver.java. Do not give your binary search driver the same name.
-Regarding the data structures you use, you can use only arrays if you want, but if you do, you'll have to figure out how to deal with the fact arrays have a fixed size. If the number of elements you're interested in goes beyond that size, your program should handle that automatically.
-Make sure you comment all methods and the class with javadoc comments. This includes constructors, getters, setters, etc.
Introduction & Driver In this assignment, your job is to write a class that searches through a file hierarchy (a tree) for a specified file. Your FindFile class will search a directory (and all subdirectories) for a target file name For example, in the file hierarchy pictured above, the file lesson .css" will be found once in a directory near the root or top-level drive name (e.g. "C:\"). Your FindFile class will start at the path indicated and will search each directory and subdirectory looking for a file match. Consider the following code that could help you build your Driver.java String targetFile -"lesson.css"; String pathToSearch "C:WCWC"; FindFile finder= new FindFile(MAX NUMBER OF FILES TO FIND): Finder.directorySearch(targetFile, pathToSearch); File Searching In general, searching can take multiple forms depending on the structure and order of the set to search If we can make promises about the data (this data is sorted, or deltas vary by no more than 10, etc.) then we can leverage those constraints to perform a more efficient search. Files in a file system are exposed to clients of the operating system and can be organized by filename, file creation date, size, and a number of other properties. We'll just be interested in the file names here, and we'll want perform a brute force (i.e., sequential) search of these files looking for a specific file. The way in which we'll get file information from the operating system will involve no ordering; as a result, a linear search is the best we can do. We'd like to search for a target file given a specified path and return the location of the file, if found. You should sketch out this logic linearly before attempting to tackle it recursively FindFile Class Interface: FindFile(int maxFiles) o This constructor accepts the maximum number of files to find void directorySearch(String target, String dirName) o The parameters are the target file name to look for and the directory to start in int getCount() o This accessor returns the number of matching files found Stringll getFiles() o This getter returns the array of file locations, up to maxFiles in size
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
