Find all the files
Find all the files
- 14
Locked
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Олег БайбулаExpert
10 March 2023, 11:25
And where is a queue in the correct solution?
0
Desislava Petrova
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.
+5
Wojtek
23 April 2019, 15:20
How to solve this task without recursion?
0
Sean
20 July 2020, 21:20
Use a queue
0