Course Java - Task: Find all the files
[Go to site: main page, start]

CodeGym/Java Tasks/Find all the files

Find all the files

  • 14
  • Locked
Find all the files
You can't complete this task, because you're not signed in.
Comments (4)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Олег Байбула
Level 32 , Ukraine
Expert
10 March 2023, 11:25
And where is a queue in the correct solution?
Desislava Petrova
Level 24 , Sofia , Bulgaria
2 May 2021, 08:43
Queue<String> queue = new LinkedList();. First put the root in a queue. while(!queue.isEmpty) Pop the file from the queue and do listFiles().If the file isDirectory() add the full(absolute) path of the file to the queue. if not add the full path of the file to the list. That's it.
Wojtek
Level 23 , Solec-Zdroj
23 April 2019, 15:20
How to solve this task without recursion?
Sean
Level 22 , Dublin, CA , United States
20 July 2020, 21:20
Use a queue