Data Structures and Algorithms in Java
Data Structures and Algorithms in Java
6th Edition
ISBN: 9781118771334
Author: Michael T. Goodrich
Publisher: WILEY
bartleby

Concept explainers

Question
Book Icon
Chapter 5, Problem 27P
Program Plan Intro

Recursive method with calling signature

Program plan:

  • Create a class FindFile.
    • In find() method,
    • Check whether the list is not “null”. If yes,
      • The for loop executes until the list. If yes,
        • Check whether the directory is there in the list. If yes,
          • Call recursively find() method to find path from the file name in the list.
        • Otherwise, check whether the given file name is equal to the filename in the list. If yes,
          • Fetch the parents file of the given file name and then display it.
    • In main() method,
      • Create an object for FindFile class.
      • Read the input file name and directory name from the user.
      • Call the find() method to find the path of the file name and then display it.

Blurred answer
Students have asked these similar questions
Implement a recursive procedure in UCBLogo, which will draw a set of circles arranged in a circle. It must be possible to specify the number of circles that have to be drawn in a simple fashion (i.e. with minor modification to the program source code).
The task is to implement part of a linter program using python. Specifically, you must be able to scan for grouping symbols ( "()", "[]", "{}” ) and ensure that there are no hanging open symbols or stray closing symbols in the source file. The implementation must involve recursion in terms of scanning for the scope. If a different closing symbol is encountered or the end of file is reached, the error message "Line : missing closing symbol for "" should be displayed. For stray closing tags, the message "Line : stray closing symbol for "". Note: Do not use "stack" in your code.
write a recursive method to schedule compatible activities that result in the maximum usage of the room.
Knowledge Booster
Background pattern image
Computer Science
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.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning