(Directory size) Listing 20.7, DirectorySize.java, gives a recursive method for finding a directory size. Rewrite this method without using recursion. Your program should use a queue to store the subdirectories under a directory. The algorithm can be described as follows:
long getSize(File directory) \{
long size $=0$;
add directory to the queue;
while (queue is not empty) \{
Remove an item from the queue into $t$;
if ( $t$ is a file)
size $+=\mathrm{t}$. length $)$;
else
add all the files and subdirectories under $t$ into the
\}
queue;
return size;
\}